<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script>
var $wnd = parent;
var $doc = $wnd.document;
var $moduleName = "index";
var $pyjs = new Object();
$pyjs.global_namespace = this;
$pyjs.__modules__ = {};
$pyjs.modules_hash = {};
$pyjs.available_modules = ['pyjslib', 'sys', 'index', 'pyjd', 'pyjamas', 'pyjamas.Window', 'pyjamas.Location', 'pyjamas.HTTPRequest', 'pygwt', 'pyjamas.JSONService', 'pyjamas.JSONParser', 'math', 'jsonrpc', 'jsonrpc.json', 'pyjamas.ui', 'pyjamas.ui.decoratorpanel', 'pyjamas.DOM', 'pyjamas.ui.SimplePanel', 'pyjamas.ui.Panel', 'pyjamas.ui.Widget', 'pyjamas.log', 'pyjamas.ui.UIObject', 'pyjamas.ui.Event', 'pyjamas.ui.TabPanel', 'pyjamas.ui.Composite', 'pyjamas.ui.DeckPanel', 'pyjamas.ui.ComplexPanel', 'pyjamas.ui.VerticalPanel', 'pyjamas.ui.CellPanel', 'pyjamas.ui.TabBar', 'pyjamas.ui.HTML', 'pyjamas.ui.Label', 'pyjamas.ui.MouseListener', 'pyjamas.ui.HorizontalPanel', 'pyjamas.ui.ClickDelegatePanel', 'pyjamas.ui.Focus', 'pyjamas.ui.KeyboardListener', 'pyjamas.ui.Button', 'pyjamas.ui.ButtonBase', 'pyjamas.ui.FocusWidget', 'pyjamas.ui.FocusListener', 'pyjamas.ui.Grid', 'pyjamas.ui.HTMLTable', 'pyjamas.ui.CellFormatter', 'pyjamas.ui.RowFormatter', 'pyjamas.ui.CheckBox', 'pyjamas.ui.AbsolutePanel', 'pyjamas.ui.RadioButton', 'pyjamas.ui.Image', 'pyjamas.ui.RootPanel', '_pyjs.js', 'pyjslib', 'sys', 'index', 'pyjd', 'pyjamas', 'pyjamas.Window', 'pyjamas.Location', 'pyjamas.HTTPRequest', 'pygwt', 'pyjamas.JSONService', 'pyjamas.JSONParser', 'math', 'jsonrpc', 'jsonrpc.json', 'pyjamas.ui', 'pyjamas.ui.decoratorpanel', 'pyjamas.DOM', 'pyjamas.ui.SimplePanel', 'pyjamas.ui.Panel', 'pyjamas.ui.Widget', 'pyjamas.log', 'pyjamas.ui.UIObject', 'pyjamas.ui.Event', 'pyjamas.ui.TabPanel', 'pyjamas.ui.Composite', 'pyjamas.ui.DeckPanel', 'pyjamas.ui.ComplexPanel', 'pyjamas.ui.VerticalPanel', 'pyjamas.ui.CellPanel', 'pyjamas.ui.TabBar', 'pyjamas.ui.HTML', 'pyjamas.ui.Label', 'pyjamas.ui.MouseListener', 'pyjamas.ui.HorizontalPanel', 'pyjamas.ui.ClickDelegatePanel', 'pyjamas.ui.Focus', 'pyjamas.ui.KeyboardListener', 'pyjamas.ui.Button', 'pyjamas.ui.ButtonBase', 'pyjamas.ui.FocusWidget', 'pyjamas.ui.FocusListener', 'pyjamas.ui.Grid', 'pyjamas.ui.HTMLTable', 'pyjamas.ui.CellFormatter', 'pyjamas.ui.RowFormatter', 'pyjamas.ui.CheckBox', 'pyjamas.ui.AbsolutePanel', 'pyjamas.ui.RadioButton', 'pyjamas.ui.Image', 'pyjamas.ui.RootPanel'];
$pyjs.loaded_modules = {};
$pyjs.options = new Object();
$pyjs.options.set_all = function (v) {
    $pyjs.options.arg_ignore = v;
    $pyjs.options.arg_count = v;
    $pyjs.options.arg_is_instance = v;
    $pyjs.options.arg_instance_type = v;
    $pyjs.options.arg_kwarg_dup = v;
    $pyjs.options.arg_kwarg_unexpected_keyword = v;
    $pyjs.options.arg_kwarg_multiple_values = v;
}
$pyjs.options.set_all(true);
$pyjs.trackstack = [];
$pyjs.track = {module:'__main__', lineno: 1};
$pyjs.trackstack.push($pyjs.track);
$pyjs.__last_exception_stack__ = null;
$pyjs.__last_exception__ = null;

/*
 * prepare app system vars
 */
$pyjs.platform = 'oldmoz';
$pyjs.appname = 'index';
$pyjs.loadpath = './';

</script>

</head>
<body onload="if (parent && parent.__pygwt_webModeFrameOnLoad) parent.__pygwt_webModeFrameOnLoad(window, 'index');">
<font face='arial' size='-1'>This script is part of module</font> <code>index</code>


<script><!--

/* early app libs */


function pyjs_kwargs_call(obj, func, star_args, dstar_args, args)
{
    if (obj !== null) {
        func = obj[func];
    }

    // Merge dstar_args into args[0]
    if (dstar_args) {
        if (pyjslib.get_pyjs_classtype(dstar_args) != 'Dict') {
            throw (pyjslib.TypeError(func.__name__ + "() arguments after ** must be a dictionary " + pyjslib.repr(dstar_args)));
        }
        var __i = dstar_args.__iter__();
        try {
            while (true) {
                var i = __i.next();
                if ($pyjs.options.arg_kwarg_multiple_values && typeof args[0][i] != 'undefined') {
                    pyjs__exception_func_multiple_values(func.__name__, i);
                }
                args[0][i] = dstar_args.__getitem__(i)
            }
        } catch (e) {
            if (e != pyjslib.StopIteration) {
                throw e;
            }
        }

    }

    // Append star_args to args
    if (star_args) {
        if (!pyjslib.isIteratable(star_args)) {
            throw (pyjslib.TypeError(func.__name__ + "() arguments after * must be a sequence" + pyjslib.repr(star_args)));
        }
        if (star_args.l != null && star_args.l.constructor == Array) {
            args = args.concat(star_args.l);
        } else {
            var call_args = Array();
            var __i = star_args.__iter__();
            var i = 0;
            try {
                while (true) {
                    call_args[i]=__i.next();
                    i++;
                }
            } catch (e) {
                if (e != pyjslib.StopIteration) {
                    throw e;
                }
            }
            args = args.concat(call_args);
        }
    }

    // Now convert args to call_args
    // args = __kwargs, arg1, arg2, ...
    // _args = arg1, arg2, arg3, ... [*args, [**kwargs]]
    var _args = [];

    // Get function/method arguments
    if (typeof func.__args__ != 'undefined') {
        var __args__ = func.__args__;
    } else {
        var __args__ = new Array(null, null);
    }

    var a, aname, _idx , idx;
    _idx = idx = 1;
    if (obj === null) {
        if (func.__is_instance__ === false) {
            // Skip first argument in __args__
            _idx ++;
        }
    } else {
        if (typeof obj.__is_instance__ == 'undefined' && typeof func.__is_instance__ != 'undefined' && func.__is_instance__ === false) {
            // Skip first argument in __args__
            _idx ++;
        } else if (func.__bind_type__ > 0) {
            if (typeof args[1] == 'undefined' || obj.__is_instance__ !== false || args[1].__is_instance__ !== true) {
                // Skip first argument in __args__
                _idx ++;
            }
        }
    }
    for (++_idx; _idx < __args__.length; _idx++, idx++) {
        aname = __args__[_idx];
        a = args[0][aname];
        if (typeof args[idx] == 'undefined') {
            _args.push(a);
            delete args[0][aname];
        } else {
            if (typeof a != 'undefined') pyjs__exception_func_multiple_values(func.__name__, aname);
            _args.push(args[idx]);
        }
    }

    // Append the left-over args
    for (;idx < args.length;idx++) {
            _args.push(args[idx]);
    }

    if (__args__[1] === null) {
        // Check for unexpected keyword
        for (var kwname in args[0]) {
            pyjs__exception_func_unexpected_keyword(func.__name__, kwname);
        }
    } else {
        _args.push(pyjslib.Dict(args[0]));
    }
    return func.apply(obj, _args);
}

function pyjs__exception_func_param(func_name, minargs, maxargs, nargs) {
    if (minargs == maxargs) {
        switch (minargs) {
            case 0:
                var msg = func_name + "() takes no arguments (" + nargs + " given)";
                break;
            case 1:
                msg = func_name + "() takes exactly " + minargs + " argument (" + nargs + " given)";
                break;
            default:
                msg = func_name + "() takes exactly " + minargs + " arguments (" + nargs + " given)";
        };
    } else if (nargs > maxargs) {
        if (maxargs == 1) {
            msg  = func_name + "() takes at most " + maxargs + " argument (" + nargs + " given)";
        } else {
            msg = func_name + "() takes at most " + maxargs + " arguments (" + nargs + " given)";
        }
    } else if (nargs < minargs) {
        if (minargs == 1) {
            msg = func_name + "() takes at least " + minargs + " argument (" + nargs + " given)";
        } else {
            msg = func_name + "() takes at least " + minargs + " arguments (" + nargs + " given)";
        }
    } else {
        return;
    }
    if (typeof pyjslib.TypeError == 'function') {
        throw pyjslib.TypeError(String(msg));
    }
    throw msg
}

function pyjs__exception_func_multiple_values(func_name, key) {
    //throw func_name + "() got multiple values for keyword argument '" + key + "'";
    throw pyjslib.TypeError(String(func_name + "() got multiple values for keyword argument '" + key + "'"));
}

function pyjs__exception_func_unexpected_keyword(func_name, key) {
    //throw func_name + "() got an unexpected keyword argument '" + key + "'";
    throw pyjslib.TypeError(String(func_name + "() got an unexpected keyword argument '" + key + "'"));
}

function pyjs__exception_func_class_expected(func_name, class_name, instance) {
        if (typeof instance == 'undefined') {
            instance = 'nothing';
        } else if (instance.__is_instance__ == null) {
            instance = "'"+String(instance)+"'";
        } else {
            instance = String(instance);
        }
        //throw "unbound method "+func_name+"() must be called with "+class_name+" class as first argument (got "+instance+" instead)";
        throw pyjslib.TypeError(String("unbound method "+func_name+"() must be called with "+class_name+" class as first argument (got "+instance+" instead)"));
}

function pyjs__exception_func_instance_expected(func_name, class_name, instance) {
        if (typeof instance == 'undefined') {
            instance = 'nothing';
        } else if (instance.__is_instance__ == null) {
            instance = "'"+String(instance)+"'";
        } else {
            instance = String(instance);
        }
        //throw "unbound method "+func_name+"() must be called with "+class_name+" instance as first argument (got "+instance+" instead)";
        throw pyjslib.TypeError(String("unbound method "+func_name+"() must be called with "+class_name+" instance as first argument (got "+instance+" instead)"));
}

function pyjs__bind_method(klass, func_name, func, bind_type, args) {
    func.__name__ = func.func_name = func_name;
    func.__bind_type__ = bind_type;
    func.__args__ = args;
    func.__class__ = klass;
    func.prototype = func;
    return func;
}
function pyjs__instancemethod(klass, func_name, func, bind_type, args) {
    var fn = function () {
        var _this = this;
        var argstart = 0;
        if (this.__is_instance__ !== true && arguments.length > 0) {
            _this = arguments[0];
            argstart = 1;
        }
        var args = new Array(_this);
        for (var a=argstart;a < arguments.length; a++) args.push(arguments[a]);
        if ($pyjs.options.arg_is_instance) {
            if (_this.__is_instance__ === true) {
                if ($pyjs.options.arg_instance_type) return func.apply(this, args);
                for (var c in _this.__mro__) {
                    var cls = _this.__mro__[c];
                    if (cls == klass) {
                        return func.apply(this, args);
                    }
                }
            }
            pyjs__exception_func_instance_expected(func_name, klass.__name__, _this);
        }
        return func.apply(this, args);
    };
    func.__name__ = func.func_name = func_name;
    func.__bind_type__ = bind_type;
    func.__args__ = args;
    func.__class__ = klass;
    return fn;
}

function pyjs__staticmethod(klass, func_name, func, bind_type, args) {
    func.__name__ = func.func_name = func_name;
    func.__bind_type__ = bind_type;
    func.__args__ = args;
    func.__class__ = klass;
    return func;
}

function pyjs__classmethod(klass, func_name, func, bind_type, args) {
    var fn = function () {
        if ($pyjs.options.arg_is_instance && this.__is_instance__ !== true && this.__is_instance__ !== false) pyjs__exception_func_instance_expected(func_name, klass.__name__);
        var args = new Array(this.prototype);
        for (var a=0;a < arguments.length; a++) args.push(arguments[a]);
        return func.apply(this, args);
    };
    func.__name__ = func.func_name = func_name;
    func.__bind_type__ = bind_type;
    func.__args__ = args;
    func.__class__ = klass;
    return fn;
}

function pyjs__subclasses__(cls_obj) {
    return cls_obj.__sub_classes__;
}

function pyjs__mro_merge(seqs) {
    var res = new Array();
    var i = 0;
    var cand = null;
    function resolve_error(candidates) {
        //throw "Cannot create a consistent method resolution order (MRO) for bases " + candidates[0].__name__ + ", "+ candidates[1].__name__;
        throw (pyjslib.TypeError("Cannot create a consistent method resolution order (MRO) for bases " + candidates[0].__name__ + ", "+ candidates[1].__name__));
    }
    for (;;) {
        var nonemptyseqs = new Array();
        for (var j = 0; j < seqs.length; j++) {
            if (seqs[j].length > 0) nonemptyseqs.push(seqs[j]);
        }
        if (nonemptyseqs.length == 0) return res;
        i++;
        var candidates = new Array();
        for (var j = 0; j < nonemptyseqs.length; j++) {
            cand = nonemptyseqs[j][0];
            candidates.push(cand);
            var nothead = new Array();
            for (var k = 0; k < nonemptyseqs.length; k++) {
                for (var m = 1; m < nonemptyseqs[k].length; m++) {
                    if (cand == nonemptyseqs[k][m]) {
                        nothead.push(nonemptyseqs[k]);
                    }
                }
            }
            if (nothead.length != 0)
                cand = null; // reject candidate
            else
                break;
        }
        if (cand == null) {
            resolve_error(candidates);
        }
        res.push(cand);
        for (var j = 0; j < nonemptyseqs.length; j++) {
            if (nonemptyseqs[j][0] == cand) {
                nonemptyseqs[j].shift();
            }
        }
    }
}

function pyjs__class_instance(class_name, module_name) {
    if (typeof module_name == 'undefined') module_name = typeof __mod_name__ == 'undefined' ? '__main__' : __mod_name__;
    var cls_fn = function(){
        var instance = cls_fn.__new__.apply(null, [cls_fn]);
        if (instance.__init__) {
            if (instance.__init__.apply(instance, arguments) != null) {
                //throw '__init__() should return None';
                throw pyjslib.TypeError('__init__() should return None');
            }
        }
        return instance;
    }
    cls_fn.__name__ = class_name;
    cls_fn.__module__ = module_name;
    cls_fn.__str__ = function() { return (this.__is_instance__ === true ? "instance of " : "class ") + (this.__module__?this.__module__ + "." : "") + this.__name__;}
    cls_fn.toString = function() { return this.__str__();};
    return cls_fn;
}

function pyjs__class_function(cls_fn, prop, bases) {
    if (typeof cls_fn != 'function') throw "compiler error? pyjs__class_function: typeof cls_fn != 'function'";
    var class_name = cls_fn.__name__;
    var class_module = cls_fn.__module__;
    var base_mro_list = new Array()
    for (var i = 0; i < bases.length; i++) {
        if (bases[i].__mro__ != null) {
            base_mro_list.push(new Array().concat(bases[i].__mro__));
        }
    }
    var __mro__ = pyjs__mro_merge(base_mro_list);

    for (var b = __mro__.length-1; b >= 0; b--) {
        var base = __mro__[b];
        for (var p in base) cls_fn[p] = base[p];
    }
    for (var p in prop) cls_fn[p] = prop[p];

    if (prop.__new__ == null) {
        cls_fn.__new__ = pyjs__bind_method(cls_fn, '__new__', function(cls) {
    var instance = function () {};
    instance.prototype = arguments[0].prototype;
    instance = new instance();
    instance.__dict__ = instance.__class__ = instance;
    instance.__is_instance__ = true;
    return instance;
}, 1, ['cls']);
    }
    if (cls_fn['__init__'] == null) {
        cls_fn['__init__'] = pyjs__bind_method(cls_fn, '__init__', function () {
    if (this.__is_instance__ === true) {
        var self = this;
        if ($pyjs.options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
    } else {
        var self = arguments[0];
        if ($pyjs.options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
        if ($pyjs.options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
    }
    if ($pyjs.options.arg_instance_type) {
        if (arguments.callee !== arguments.callee.__class__[arguments.callee.__name__]) {
            if (!pyjslib._isinstance(self, arguments.callee.__class__.slice(1))) {
                pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
            }
        }
    }
}, 0, ['self']);
    }
    cls_fn.__name__ = class_name;
    cls_fn.__module__ = class_module;
    //cls_fn.__mro__ = pyjslib.List(new Array(cls_fn).concat(__mro__));
    cls_fn.__mro__ = new Array(cls_fn).concat(__mro__);
    cls_fn.prototype = cls_fn;
    cls_fn.__dict__ = cls_fn;
    cls_fn.__is_instance__ = false;
    cls_fn.__super_classes__ = bases;
    cls_fn.__sub_classes__ = new Array();
    for (var i = 0; i < bases.length; i++) {
        (bases[i]).__sub_classes__.push(cls_fn);
    }
    cls_fn.__args__ = cls_fn.__init__.__args__;
    return cls_fn;
}

/* creates a class, derived from bases, with methods and variables */
function pyjs_type(clsname, bases, methods)
{
    var cls_instance = pyjs__class_instance(clsname);
    var obj = new Object;
    for (var i in methods) {
        if (typeof methods[i] == 'function') {
            obj[i] = pyjs__instancemethod(cls_instance, i, methods[i], methods[i].__bind_type__, methods[i].__args__);
        } else {
            obj[i] = methods[i];
        }
    }
    return pyjs__class_function(cls_instance, obj, bases);
}



/* early static js libs */



/* static js libs */



/* app libs */

/* start module: pyjslib */
var pyjslib = $pyjs.loaded_modules["pyjslib"] = function (__mod_name__) {
if(pyjslib.__was_initialized__) return pyjslib;
pyjslib.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjslib';
var __name__ = pyjslib.__name__ = __mod_name__;
pyjslib.object = (function(){
	var cls_instance = pyjs__class_instance('object');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'd3dba22d06267294aa8ed4fd1efaad06';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array());
})();
pyjslib.__import__ = function(searchList, path, context, module_name) {
	if (typeof module_name == 'undefined') module_name=null;
	var available,importName,err,temp_i,mod_path,found,i,m,l,module,name,parts,pyjs_try_err,save_track_module;
	available = $pyjs.available_modules_dict;
	if (pyjslib.bool(pyjslib.isUndefined(available))) {
		available = new pyjslib.Dict([]);
		var __m = pyjslib.list($pyjs.available_modules).__iter__();
		try {
			while (true) {
				var m = __m.next();
				
				available.__setitem__(m, false);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
$pyjs.available_modules_dict = available;
	}
	searchList = pyjslib.list(searchList);
	found = false;
	var __mod_path = searchList.__iter__();
	try {
		while (true) {
			var mod_path = __mod_path.next();
			
			if (pyjslib.bool(available.__contains__(mod_path))) {
				found = true;
				break;
			}
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	if (pyjslib.bool(!(found))) {
		throw (pyjslib.ImportError( (  (  (  ( String('No module named ') + path )  + String(' (context=') )  + context )  + String(')') ) ));
	}
	module = null;
	try {
		module = $pyjs.loaded_modules[mod_path];
		if (pyjslib.bool(typeof module.__was_initialized__ != 'undefined')) {
			return null;
		}
	} catch(pyjs_try_err) {
		var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
		$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjslib, try_lineno: 75};
		{
			$pyjs.__last_exception__.except_lineno = 80;
			err = pyjs_try_err;
		} 	}
	save_track_module = $pyjs.track.module;
	importName = String('');
	parts = mod_path.split(String('.'));
	l = pyjslib.len(parts);
	var __temp_i = pyjslib.enumerate(parts).__iter__();
	try {
		while (true) {
			var temp_i = __temp_i.next();
				var i = temp_i.__getitem__(0);	var name = temp_i.__getitem__(1);
			importName += name;
module = $pyjs.loaded_modules[importName];
			if (pyjslib.bool(typeof module == 'undefined')) {
				throw (pyjslib.ImportError( (  (  (  (  ( String('No module named ') + importName )  + String(', ') )  + path )  + String(' in context ') )  + context ) ));
			}
			if (pyjslib.bool(pyjslib.eq(i, 0))) {
$pyjs.__modules__[importName] = module;
			}
			if (pyjslib.bool(pyjslib.eq(l,  ( i + 1 ) ))) {
				module(module_name);
			}
			else {
				module(null);
			}
			importName += String('.');
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
$pyjs.track.module = save_track_module;
};
pyjslib.__import__.__name__ = '__import__';

pyjslib.__import__.__bind_type__ = 0;
pyjslib.__import__.__args__ = [null,null,'searchList', 'path', 'context', 'module_name'];
pyjslib.load_module = function(path, parent_module, module_name, dynamic, async) {
	if (typeof dynamic == 'undefined') dynamic=1;
	if (typeof async == 'undefined') async=false;


        var cache_file;
        var module = $pyjs.modules_hash[module_name];
        if (typeof module == 'function') {
            return true;
        }

        if (!dynamic) {
            // There's no way we can load a none dynamic module
            return false;
        }

        if (path == null)
        {
            path = './';
        }

        var override_name = sys.platform + "." + module_name;
        if (((sys.overrides != null) &&
             (sys.overrides.has_key(override_name))))
        {
            cache_file =  sys.overrides.__getitem__(override_name) ;
        }
        else
        {
            cache_file =  module_name ;
        }

        cache_file = (path + cache_file + '.cache.js' ) ;

        //alert("cache " + cache_file + " " + module_name + " " + parent_module);

        onload_fn = '';

        // this one tacks the script onto the end of the DOM
        pyjs_load_script(cache_file, onload_fn, async);

        try {
            loaded = (typeof $pyjs.modules_hash[module_name] == 'function');
        } catch ( e ) {
        }
        if (loaded) {
            return true;
        }
        return false;
    
};
pyjslib.load_module.__name__ = 'load_module';

pyjslib.load_module.__bind_type__ = 0;
pyjslib.load_module.__args__ = [null,null,'path', 'parent_module', 'module_name', 'dynamic', 'async'];
pyjslib.load_module_wait = function(proceed_fn, parent_mod, module_list, dynamic) {

	module_list = module_list.getArray();

    var wait_count = 0;
    var timeoutperiod = 1;
    if (dynamic)
        var timeoutperiod = 1;

    var wait = function() {
        wait_count++;
        //write_dom(".");
        var loaded = true;
        for (var i in module_list) {
            if (typeof $pyjs.modules_hash[module_list[i]] != 'function') {
                loaded = false;
                break;
            }
        }
        if (!loaded) {
            setTimeout(wait, timeoutperiod);
        } else {
            if (proceed_fn.importDone)
                proceed_fn.importDone(proceed_fn);
            else
                proceed_fn();
            //$doc.body.removeChild(element);
        }
    };
    wait();

};
pyjslib.load_module_wait.__name__ = 'load_module_wait';

pyjslib.load_module_wait.__bind_type__ = 0;
pyjslib.load_module_wait.__args__ = [null,null,'proceed_fn', 'parent_mod', 'module_list', 'dynamic'];
pyjslib.Modload = (function(){
	var cls_instance = pyjs__class_instance('Modload');
	var cls_definition = new Object();
	cls_definition.__md5__ = '008a15ebcd1aa61ea5f3fd5abe9c6b1d';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(path, app_modlist, app_imported_fn, dynamic, parent_mod) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			path = arguments[1];
			app_modlist = arguments[2];
			app_imported_fn = arguments[3];
			dynamic = arguments[4];
			parent_mod = arguments[5];
		}
		var depth,mod,modlist;
		self.app_modlist = app_modlist;
		self.app_imported_fn = app_imported_fn;
		self.path = path;
		self.dynamic = dynamic;
		self.parent_mod = parent_mod;
		self.modules = new pyjslib.Dict([]);
		var __modlist = self.app_modlist.__iter__();
		try {
			while (true) {
				var modlist = __modlist.next();
				
				var __mod = modlist.__iter__();
				try {
					while (true) {
						var mod = __mod.next();
						
						depth = pyjslib.len(mod.split(String('.')));
						if (pyjslib.bool(!(self.modules.has_key(depth)))) {
							self.modules.__setitem__(depth, new pyjslib.List([]));
						}
						self.modules.__getitem__(depth).append(mod);
					}
				} catch (e) {
					if (e.__name__ != 'StopIteration') {
						throw e;
					}
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		self.depths = self.modules.keys();
		self.depths.sort();
		self.depths.reverse();
		return null;
	}
	, 1, [null,null,'self', 'path', 'app_modlist', 'app_imported_fn', 'dynamic', 'parent_mod']);
	cls_definition.next = pyjs__bind_method(cls_instance, 'next', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var app,depth;
		if (pyjslib.bool(!(self.dynamic))) {
			self.app_imported_fn();
			return null;
		}
		depth = self.depths.pop();
		var __app = self.modules.__getitem__(depth).__iter__();
		try {
			while (true) {
				var app = __app.next();
				
				pyjslib.load_module(self.path, self.parent_mod, app, self.dynamic, true);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (pyjslib.bool(pyjslib.eq(pyjslib.len(self.depths), 0))) {
			pyjslib.load_module_wait(self.app_imported_fn, self.parent_mod, self.modules.__getitem__(depth), self.dynamic);
		}
		else {
			pyjslib.load_module_wait(pyjslib.getattr(self, String('next')), self.parent_mod, self.modules.__getitem__(depth), self.dynamic);
		}
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjslib.get_module = function(module_name) {
	var ev;
	ev = pyjslib.sprintf(String('__mod = %s\x3B'), module_name);
pyjs_eval(ev);
	return pyjslib.__mod;
};
pyjslib.get_module.__name__ = 'get_module';

pyjslib.get_module.__bind_type__ = 0;
pyjslib.get_module.__args__ = [null,null,'module_name'];
pyjslib.preload_app_modules = function(path, app_modnames, app_imported_fn, dynamic, parent_mod) {
	if (typeof parent_mod == 'undefined') parent_mod=null;
	var loader;
	loader = pyjslib.Modload(path, app_modnames, app_imported_fn, dynamic, parent_mod);
	loader.next();
	return null;
};
pyjslib.preload_app_modules.__name__ = 'preload_app_modules';

pyjslib.preload_app_modules.__bind_type__ = 0;
pyjslib.preload_app_modules.__args__ = [null,null,'path', 'app_modnames', 'app_imported_fn', 'dynamic', 'parent_mod'];
pyjslib.BaseException = (function(){
	var cls_instance = pyjs__class_instance('BaseException');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'f1d727002fa12d6dd2e8d09d79693975';
	cls_definition.message = String('');
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var args = new Array();
			for (var pyjs__va_arg = 0; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
				var pyjs__arg = arguments[pyjs__va_arg];
				args.push(pyjs__arg);
			}
			args = pyjslib.Tuple(args);

		} else {
			var self = arguments[0];
			var args = new Array();
			for (var pyjs__va_arg = 1; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
				var pyjs__arg = arguments[pyjs__va_arg];
				args.push(pyjs__arg);
			}
			args = pyjslib.Tuple(args);

		}

		self.args = args;
		if (pyjslib.bool(pyjslib.eq(pyjslib.len(args), 1))) {
			self.message = args.__getitem__(0);
		}
		return null;
	}
	, 1, ['args',null,'self']);
	cls_definition.__getitem__ = pyjs__bind_method(cls_instance, '__getitem__', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		return self.args.__getitem__(index);
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool((pyjslib.len(self.args) === 0))) {
			return String('');
		}
		else if (pyjslib.bool((pyjslib.len(self.args) === 1))) {
			return pyjslib.str(self.message);
		}
		return pyjslib.repr(self.args);
	}
	, 1, [null,null,'self']);
	cls_definition.__repr__ = pyjs__bind_method(cls_instance, '__repr__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return  ( self.__name__ + pyjslib.repr(self.args) ) ;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjslib.Exception = (function(){
	var cls_instance = pyjs__class_instance('Exception');
	var cls_definition = new Object();
	cls_definition.__md5__ = '9508f85d2f22b22663319149c9964f06';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.BaseException));
})();
pyjslib.StandardError = (function(){
	var cls_instance = pyjs__class_instance('StandardError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '213b930f4906fde5d906fa662003b3c2';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.Exception));
})();
pyjslib.TypeError = (function(){
	var cls_instance = pyjs__class_instance('TypeError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '89693a26cd50bcd20fcf9c303b63dce0';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.StandardError));
})();
pyjslib.AttributeError = (function(){
	var cls_instance = pyjs__class_instance('AttributeError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '93d988c4d421ef5b62c9846e29d99ed5';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.StandardError));
})();
pyjslib.NameError = (function(){
	var cls_instance = pyjs__class_instance('NameError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '300907dcbb08b00428dd22a96a858802';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.StandardError));
})();
pyjslib.ValueError = (function(){
	var cls_instance = pyjs__class_instance('ValueError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '7493284ae4397433bf46f2f42cd1dafb';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.StandardError));
})();
pyjslib.ImportError = (function(){
	var cls_instance = pyjs__class_instance('ImportError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '5307eac7178fc380fad56988ac2736cc';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.StandardError));
})();
pyjslib.LookupError = (function(){
	var cls_instance = pyjs__class_instance('LookupError');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'c21926c80c3c6bb9275cd8d8e799253a';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.StandardError));
})();
pyjslib.RuntimeError = (function(){
	var cls_instance = pyjs__class_instance('RuntimeError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '2617eb57e03a2c46e8e339d9249c055b';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.StandardError));
})();
pyjslib.KeyError = (function(){
	var cls_instance = pyjs__class_instance('KeyError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '5675b861a8ea4c3633be50ae72ce774a';
	cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool((pyjslib.len(self.args) === 0))) {
			return String('');
		}
		else if (pyjslib.bool((pyjslib.len(self.args) === 1))) {
			return pyjslib.repr(self.message);
		}
		return pyjslib.repr(self.args);
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.LookupError));
})();
pyjslib.IndexError = (function(){
	var cls_instance = pyjs__class_instance('IndexError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '30eec223583ad344b0f3f54815aad98d';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.LookupError));
})();
pyjslib.NotImplementedError = (function(){
	var cls_instance = pyjs__class_instance('NotImplementedError');
	var cls_definition = new Object();
	cls_definition.__md5__ = '463326706eddf9c8b49cb5fdb56595c8';
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.RuntimeError));
})();
pyjslib.init = function() {


pyjslib._errorMapping = function(err) {
    if (err instanceof(ReferenceError) || err instanceof(TypeError)) {
        var message = '';
        try {
            message = err.message;
        } catch ( e) {
        }
        return pyjslib.AttributeError(message);
    }
    return err;
};

pyjslib.TryElse = function () { };
pyjslib.TryElse.prototype = new Error();
pyjslib.TryElse.__name__ = 'TryElse';
pyjslib.TryElse.message = 'TryElse';

pyjslib.StopIteration = function () { };
pyjslib.StopIteration.prototype = new Error();
pyjslib.StopIteration.__name__ = 'StopIteration';
pyjslib.StopIteration.message = 'StopIteration';

pyjslib.String_find = function(sub, start, end) {
    var pos=this.indexOf(sub, start);
    if (pyjslib.isUndefined(end)) return pos;

    if (pos + sub.length>end) return -1;
    return pos;
};

pyjslib.String_join = function(data) {
    var text="";

    if (data.constructor == Array) {
        return data.join(this);
    }
    else if (data.prototype.__md5__ == pyjslib.List.prototype.__md5__) {
        return data.l.join(this);
    }
    else if (pyjslib.isIteratable(data)) {
        var iter=data.__iter__();
        try {
            text+=iter.next();
            while (true) {
                var item=iter.next();
                text+=this + item;
            }
        }
        catch (e) {
            if (e.__name__ != 'StopIteration') throw e;
        }
    }

    return text;
};

pyjslib.String_isdigit = function() {
    return (this.match(/^\d+$/g) != null);
};

pyjslib.String_replace = function(old, replace, count) {
    var do_max=false;
    var start=0;
    var new_str="";
    var pos=0;

    if (!pyjslib.isString(old)) return this.__replace(old, replace);
    if (!pyjslib.isUndefined(count)) do_max=true;

    while (start<this.length) {
        if (do_max && !count--) break;

        pos=this.indexOf(old, start);
        if (pos<0) break;

        new_str+=this.substring(start, pos) + replace;
        start=pos+old.length;
    }
    if (start<this.length) new_str+=this.substring(start);

    return new_str;
};

pyjslib.String___contains__ = function(s){
    return this.indexOf(s)>=0;
};

pyjslib.String_split = function(sep, maxsplit) {
    var items=new pyjslib.List();
    var do_max=false;
    var subject=this;
    var start=0;
    var pos=0;

    if (pyjslib.isUndefined(sep) || pyjslib.isNull(sep)) {
        sep=" ";
        subject=subject.strip();
        subject=subject.replace(/\s+/g, sep);
    }
    else if (!pyjslib.isUndefined(maxsplit)) do_max=true;

    if (subject.length == 0) {
        return items;
    }

    while (start<subject.length) {
        if (do_max && !maxsplit--) break;

        pos=subject.indexOf(sep, start);
        if (pos<0) break;

        items.append(subject.substring(start, pos));
        start=pos+sep.length;
    }
    if (start<=subject.length) items.append(subject.substring(start));

    return items;
};

pyjslib.String___iter__ = function() {
    var i = 0;
    var s = this;
    return {
        'next': function() {
            if (i >= s.length) {
                throw pyjslib.StopIteration;
            }
            return s.substring(i++, i, 1);
        },
        '__iter__': function() {
            return this;
        }
    };
};

pyjslib.String_strip = function(chars) {
    return this.lstrip(chars).rstrip(chars);
};

pyjslib.String_lstrip = function(chars) {
    if (pyjslib.isUndefined(chars)) return this.replace(/^\s+/, "");
    if (chars.length == 0) return this;
    return this.replace(new RegExp("^[" + chars + "]+"), "");
};

pyjslib.String_rstrip = function(chars) {
    if (pyjslib.isUndefined(chars)) return this.replace(/\s+$/, "");
    if (chars.length == 0) return this;
    return this.replace(new RegExp("[" + chars + "]+$"), "");
};

pyjslib.String_startswith = function(prefix, start, end) {
    // FIXME: accept tuples as suffix (since 2.5)
    if (pyjslib.isUndefined(start)) start = 0;
    if (pyjslib.isUndefined(end)) end = this.length;

    if ((end - start) < prefix.length) return false;
    if (this.substr(start, prefix.length) == prefix) return true;
    return false;
};

pyjslib.String_endswith = function(suffix, start, end) {
    // FIXME: accept tuples as suffix (since 2.5)
    if (pyjslib.isUndefined(start)) start = 0;
    if (pyjslib.isUndefined(end)) end = this.length;

    if ((end - start) < suffix.length) return false;
    if (this.substr(end - suffix.length, suffix.length) == suffix) return true;
    return false;
};

pyjslib.String_ljust = function(width, fillchar) {
    if (typeof(width) != 'number' ||
        parseInt(width) != width) {
        throw (pyjslib.TypeError("an integer is required"));
    }
    if (pyjslib.isUndefined(fillchar)) fillchar = ' ';
    if (typeof(fillchar) != 'string' ||
        fillchar.length != 1) {
        throw (pyjslib.TypeError("ljust() argument 2 must be char, not " + typeof(fillchar)));
    }
    if (this.length >= width) return this;
    return this + new Array(width+1 - this.length).join(fillchar);
};

pyjslib.String_rjust = function(width, fillchar) {
    if (typeof(width) != 'number' ||
        parseInt(width) != width) {
        throw (pyjslib.TypeError("an integer is required"));
    }
    if (pyjslib.isUndefined(fillchar)) fillchar = ' ';
    if (typeof(fillchar) != 'string' ||
        fillchar.length != 1) {
        throw (pyjslib.TypeError("rjust() argument 2 must be char, not " + typeof(fillchar)));
    }
    if (this.length >= width) return this;
    return new Array(width + 1 - this.length).join(fillchar) + this;
};

pyjslib.String_center = function(width, fillchar) {
    if (typeof(width) != 'number' ||
        parseInt(width) != width) {
        throw (pyjslib.TypeError("an integer is required"));
    }
    if (pyjslib.isUndefined(fillchar)) fillchar = ' ';
    if (typeof(fillchar) != 'string' ||
        fillchar.length != 1) {
        throw (pyjslib.TypeError("center() argument 2 must be char, not " + typeof(fillchar)));
    }
    if (this.length >= width) return this;
    padlen = width - this.length;
    right = Math.ceil(padlen / 2);
    left = padlen - right;
    return new Array(left+1).join(fillchar) + this + new Array(right+1).join(fillchar);
};

pyjslib.String___getitem__ = function(idx) {
    if (idx < 0) idx += this.length;
    if (idx < 0 || idx > this.length) {
        throw(pyjslib.IndexError("string index out of range"));
    }
    return this.charAt(idx);
};

pyjslib.abs = Math.abs;

String.prototype.__getitem__ = pyjslib.String___getitem__;
String.prototype.upper = String.prototype.toUpperCase;
String.prototype.lower = String.prototype.toLowerCase;
String.prototype.find=pyjslib.String_find;
String.prototype.join=pyjslib.String_join;
String.prototype.isdigit=pyjslib.String_isdigit;
String.prototype.__iter__=pyjslib.String___iter__;
String.prototype.__contains__=pyjslib.String___contains__;

String.prototype.__replace=String.prototype.replace;
String.prototype.replace=pyjslib.String_replace;

String.prototype.split=pyjslib.String_split;
String.prototype.strip=pyjslib.String_strip;
String.prototype.lstrip=pyjslib.String_lstrip;
String.prototype.rstrip=pyjslib.String_rstrip;
String.prototype.startswith=pyjslib.String_startswith;
String.prototype.endswith=pyjslib.String_endswith;
String.prototype.ljust=pyjslib.String_ljust;
String.prototype.rjust=pyjslib.String_rjust;
String.prototype.center=pyjslib.String_center;

var str = String;

};
pyjslib.init.__name__ = 'init';

pyjslib.init.__bind_type__ = 0;
pyjslib.init.__args__ = [null,null];
pyjslib.Class = (function(){
	var cls_instance = pyjs__class_instance('Class');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'fb75ea67a9c76c97a2201e52e795cd50';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(name) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			name = arguments[1];
		}

		self.name_ = name;
		return null;
	}
	, 1, [null,null,'self', 'name']);
	cls_definition.__str___ = pyjs__bind_method(cls_instance, '__str___', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.name_;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjslib.eq = function(a, b) {


    if (a === null) {
        if (b === null) return true;
        return false;
    }
    if (b === null) {
        return false;
    }
    if ((typeof a == 'object' || typeof a == 'function') && typeof a.__cmp__ == 'function') {
        return a.__cmp__(b) == 0;
    } else if ((typeof b == 'object' || typeof b == 'function') && typeof b.__cmp__ == 'function') {
        return b.__cmp__(a) == 0;
    }
    return a == b;
    
};
pyjslib.eq.__name__ = 'eq';

pyjslib.eq.__bind_type__ = 0;
pyjslib.eq.__args__ = [null,null,'a', 'b'];
pyjslib.cmp = function(a, b) {


    if (a === null) {
        if (b === null) return 0;
        return -1;
    }
    if (b === null) {
        return 1;
    }
    if ((typeof a == 'object' || typeof a == 'function') && typeof a.__cmp__ == 'function') {
        return a.__cmp__(b);
    } else if ((typeof b == 'object' || typeof b == 'function') && typeof b.__cmp__ == 'function') {
        return -b.__cmp__(a);
    }
    if (a > b) return 1;
    if (b > a) return -1;
    return 0;
    
};
pyjslib.cmp.__name__ = 'cmp';

pyjslib.cmp.__bind_type__ = 0;
pyjslib.cmp.__args__ = [null,null,'a', 'b'];
pyjslib.bool = function(v) {


    if (!v) return false;
    switch(typeof v){
    case 'boolean':
        return v;
    case 'object':
        if (v.__nonzero__){
            return v.__nonzero__();
        }else if (v.__len__){
            return v.__len__()>0;
        }
        return true;
    }
    return Boolean(v);
    
};
pyjslib.bool.__name__ = 'bool';

pyjslib.bool.__bind_type__ = 0;
pyjslib.bool.__args__ = [null,null,'v'];
pyjslib.List = (function(){
	var cls_instance = pyjs__class_instance('List');
	var cls_definition = new Object();
	cls_definition.__md5__ = '5edaa2eb43414b884b62df4433ca9871';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			data = arguments[1];
		}
		if (typeof data == 'undefined') data=null;


        this.l = [];
        this.extend(data);
        
	}
	, 1, [null,null,'self', 'data']);
	cls_definition.append = pyjs__bind_method(cls_instance, 'append', function(item) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			item = arguments[1];
		}

    this.l[this.l.length] = item;
	}
	, 1, [null,null,'self', 'item']);
	cls_definition.extend = pyjs__bind_method(cls_instance, 'extend', function(data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			data = arguments[1];
		}


        if (pyjslib.isArray(data)) {
            n = this.l.length;
            for (var i=0; i < data.length; i++) {
                this.l[n+i]=data[i];
                }
            }
        else if (pyjslib.isIteratable(data)) {
            var iter=data.__iter__();
            var i=this.l.length;
            try {
                while (true) {
                    var item=iter.next();
                    this.l[i++]=item;
                    }
                }
            catch (e) {
                if (e.__name__ != 'StopIteration') throw e;
                }
            }
        
	}
	, 1, [null,null,'self', 'data']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			value = arguments[1];
		}


        var index=this.index(value);
        if (index<0) return false;
        this.l.splice(index, 1);
        return true;
        
	}
	, 1, [null,null,'self', 'value']);
	cls_definition.index = pyjs__bind_method(cls_instance, 'index', function(value, start) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			value = arguments[1];
			start = arguments[2];
		}
		if (typeof start == 'undefined') start=0;


        var result = this.l.indexOf(value, start);
        if (result >= 0)
            return result;
        
		throw (pyjslib.ValueError(String('list.index(x): x not in list')));
		return null;
	}
	, 1, [null,null,'self', 'value', 'start']);
	cls_definition.insert = pyjs__bind_method(cls_instance, 'insert', function(index, value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
			value = arguments[2];
		}

    var a = this.l; this.l=a.slice(0, index).concat(value, a.slice(index));
	}
	, 1, [null,null,'self', 'index', 'value']);
	cls_definition.pop = pyjs__bind_method(cls_instance, 'pop', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}
		if (typeof index == 'undefined') index=-1;


        if (index<0) index = this.l.length + index;
        var a = this.l[index];
        this.l.splice(index, 1);
        return a;
        
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.__cmp__ = pyjs__bind_method(cls_instance, '__cmp__', function(l) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			l = arguments[1];
		}
		var x,ll;
		if (pyjslib.bool(!(pyjslib.isinstance(l, pyjslib.List)))) {
			return -1;
		}
		ll =  ( pyjslib.len(self) - pyjslib.len(l) ) ;
		if (pyjslib.bool(!pyjslib.eq(ll, 0))) {
			return ll;
		}
		var __x = pyjslib.range(pyjslib.len(l)).__iter__();
		try {
			while (true) {
				var x = __x.next();
				
				ll = pyjslib.cmp(self.__getitem__(x), l.__getitem__(x));
				if (pyjslib.bool(!pyjslib.eq(ll, 0))) {
					return ll;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return 0;
	}
	, 1, [null,null,'self', 'l']);
	cls_definition.slice = pyjs__bind_method(cls_instance, 'slice', function(lower, upper) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			lower = arguments[1];
			upper = arguments[2];
		}


        if (upper==null) return pyjslib.List(this.l.slice(lower));
        return pyjslib.List(this.l.slice(lower, upper));
        
	}
	, 1, [null,null,'self', 'lower', 'upper']);
	cls_definition.__getitem__ = pyjs__bind_method(cls_instance, '__getitem__', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}


        if (index<0) index = this.l.length + index;
        return this.l[index];
        
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.__setitem__ = pyjs__bind_method(cls_instance, '__setitem__', function(index, value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
			value = arguments[2];
		}

    this.l[index]=value;
	}
	, 1, [null,null,'self', 'index', 'value']);
	cls_definition.__delitem__ = pyjs__bind_method(cls_instance, '__delitem__', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

    this.l.splice(index, 1);
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.__len__ = pyjs__bind_method(cls_instance, '__len__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

    return this.l.length;
	}
	, 1, [null,null,'self']);
	cls_definition.__contains__ = pyjs__bind_method(cls_instance, '__contains__', function(value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			value = arguments[1];
		}
		var err,pyjs_try_err;
		try {
			self.index(value);
		} catch(pyjs_try_err) {
			var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
			$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjslib, try_lineno: 753};
			if (pyjs_try_err_name == pyjslib.ValueError.__name__) {
				$pyjs.__last_exception__.except_lineno = 755;
				err = pyjs_try_err;
				return false;
			} else { throw pyjs_try_err; }
		}
		return true;
	}
	, 1, [null,null,'self', 'value']);
	cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var i = 0;
        var l = this.l;
        return {
            'next': function() {
                if (i >= l.length) {
                    throw pyjslib.StopIteration;
                }
                return l[i++];
            },
            '__iter__': function() {
                return this;
            }
        };
        
	}
	, 1, [null,null,'self']);
	cls_definition.reverse = pyjs__bind_method(cls_instance, 'reverse', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

    this.l.reverse();
	}
	, 1, [null,null,'self']);
	cls_definition.sort = pyjs__bind_method(cls_instance, 'sort', function(compareFunc, keyFunc, reverse) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			compareFunc = arguments[1];
			keyFunc = arguments[2];
			reverse = arguments[3];
		}
		if (typeof compareFunc == 'undefined') compareFunc=null;
		if (typeof keyFunc == 'undefined') keyFunc=null;
		if (typeof reverse == 'undefined') reverse=false;
		var thisSort1,thisSort2,thisSort3;
		if (pyjslib.bool(!(compareFunc))) {
			compareFunc = pyjslib.cmp;
		}
		if (pyjslib.bool((keyFunc) && (reverse))) {
			thisSort1 = function(a, b) {

				return -compareFunc(keyFunc(a), keyFunc(b));
			};
			thisSort1.__name__ = 'thisSort1';

			thisSort1.__bind_type__ = 0;
			thisSort1.__args__ = [null,null,'a', 'b'];
			self.l.sort(thisSort1);
		}
		else if (pyjslib.bool(keyFunc)) {
			thisSort2 = function(a, b) {

				return compareFunc(keyFunc(a), keyFunc(b));
			};
			thisSort2.__name__ = 'thisSort2';

			thisSort2.__bind_type__ = 0;
			thisSort2.__args__ = [null,null,'a', 'b'];
			self.l.sort(thisSort2);
		}
		else if (pyjslib.bool(reverse)) {
			thisSort3 = function(a, b) {

				return -compareFunc(a, b);
			};
			thisSort3.__name__ = 'thisSort3';

			thisSort3.__bind_type__ = 0;
			thisSort3.__args__ = [null,null,'a', 'b'];
			self.l.sort(thisSort3);
		}
		else {
			self.l.sort(compareFunc);
		}
		return null;
	}
	, 1, [null,null,'self', 'compareFunc', 'keyFunc', 'reverse']);
	cls_definition.getArray = pyjs__bind_method(cls_instance, 'getArray', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.l;
	}
	, 1, [null,null,'self']);
	cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.__repr__();
	}
	, 1, [null,null,'self']);
	cls_definition.__repr__ = pyjs__bind_method(cls_instance, '__repr__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var s = "[";
        for (var i=0; i < self.l.length; i++) {
            s += pyjslib.repr(self.l[i]);
            if (i < self.l.length - 1)
                s += ", ";
        }
        s += "]";
        return s;
        
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjslib.list = pyjslib.List;
pyjslib.Tuple = (function(){
	var cls_instance = pyjs__class_instance('Tuple');
	var cls_definition = new Object();
	cls_definition.__md5__ = '01fe44d8045614dbfe219efda976204d';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			data = arguments[1];
		}
		if (typeof data == 'undefined') data=null;


        this.l = [];
        if (pyjslib.isArray(data)) {
            n = this.l.length;
            for (var i=0; i < data.length; i++) {
                this.l[n+i]=data[i];
                }
            }
        else if (pyjslib.isIteratable(data)) {
            var iter=data.__iter__();
            var i=this.l.length;
            try {
                while (true) {
                    var item=iter.next();
                    this.l[i++]=item;
                    }
                }
            catch (e) {
                if (e.__name__ != 'StopIteration') throw e;
                }
            }
        
	}
	, 1, [null,null,'self', 'data']);
	cls_definition.__cmp__ = pyjs__bind_method(cls_instance, '__cmp__', function(l) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			l = arguments[1];
		}
		var x,ll;
		if (pyjslib.bool(!(pyjslib.isinstance(l, pyjslib.Tuple)))) {
			return 1;
		}
		ll =  ( pyjslib.len(self) - pyjslib.len(l) ) ;
		if (pyjslib.bool(!pyjslib.eq(ll, 0))) {
			return ll;
		}
		var __x = pyjslib.range(pyjslib.len(l)).__iter__();
		try {
			while (true) {
				var x = __x.next();
				
				ll = pyjslib.cmp(self.__getitem__(x), l.__getitem__(x));
				if (pyjslib.bool(!pyjslib.eq(ll, 0))) {
					return ll;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return 0;
	}
	, 1, [null,null,'self', 'l']);
	cls_definition.slice = pyjs__bind_method(cls_instance, 'slice', function(lower, upper) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			lower = arguments[1];
			upper = arguments[2];
		}


        if (upper==null) return pyjslib.Tuple(this.l.slice(lower));
        return pyjslib.Tuple(this.l.slice(lower, upper));
        
	}
	, 1, [null,null,'self', 'lower', 'upper']);
	cls_definition.__getitem__ = pyjs__bind_method(cls_instance, '__getitem__', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}


        if (index<0) index = this.l.length + index;
        return this.l[index];
        
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.__len__ = pyjs__bind_method(cls_instance, '__len__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

    return this.l.length;
	}
	, 1, [null,null,'self']);
	cls_definition.__contains__ = pyjs__bind_method(cls_instance, '__contains__', function(value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			value = arguments[1];
		}

		return self.l.indexOf(value)>=0;
	}
	, 1, [null,null,'self', 'value']);
	cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var i = 0;
        var l = this.l;
        return {
            'next': function() {
                if (i >= l.length) {
                    throw pyjslib.StopIteration;
                }
                return l[i++];
            },
            '__iter__': function() {
                return this;
            }
        };
        
	}
	, 1, [null,null,'self']);
	cls_definition.getArray = pyjs__bind_method(cls_instance, 'getArray', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.l;
	}
	, 1, [null,null,'self']);
	cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.__repr__();
	}
	, 1, [null,null,'self']);
	cls_definition.__repr__ = pyjs__bind_method(cls_instance, '__repr__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var s = "(";
        for (var i=0; i < self.l.length; i++) {
            s += pyjslib.repr(self.l[i]);
            if (i < self.l.length - 1)
                s += ", ";
        }
        if (self.l.length == 1)
            s += ",";
        s += ")";
        return s;
        
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjslib.tuple = pyjslib.Tuple;
pyjslib.Dict = (function(){
	var cls_instance = pyjs__class_instance('Dict');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'a70ac8e9cbf67304fa20d92007161d54';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			data = arguments[1];
		}
		if (typeof data == 'undefined') data=null;


        this.d = {};

        if (pyjslib.isArray(data)) {
            for (var i in data) {
                var item=data[i];
                this.__setitem__(item[0], item[1]);
                //var sKey=pyjslib.hash(item[0]);
                //this.d[sKey]=item[1];
                }
            }
        else if (pyjslib.isIteratable(data)) {
            var iter=data.__iter__();
            try {
                while (true) {
                    var item=iter.next();
                    this.__setitem__(item.__getitem__(0), item.__getitem__(1));
                    }
                }
            catch (e) {
                if (e.__name__ != 'StopIteration') throw e;
                }
            }
        else if (pyjslib.isObject(data)) {
            for (var key in data) {
                this.__setitem__(key, data[key]);
                }
            }
        
	}
	, 1, [null,null,'self', 'data']);
	cls_definition.__setitem__ = pyjs__bind_method(cls_instance, '__setitem__', function(key, value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
			value = arguments[2];
		}


        var sKey = pyjslib.hash(key);
        this.d[sKey]=[key, value];
        
	}
	, 1, [null,null,'self', 'key', 'value']);
	cls_definition.__getitem__ = pyjs__bind_method(cls_instance, '__getitem__', function(key) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
		}


        var sKey = pyjslib.hash(key);
        var value=this.d[sKey];
        if (pyjslib.isUndefined(value)){
            throw pyjslib.KeyError(key);
        }
        return value[1];
        
	}
	, 1, [null,null,'self', 'key']);
	cls_definition.__nonzero__ = pyjs__bind_method(cls_instance, '__nonzero__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        for (var i in this.d){
            return true;
        }
        return false;
        
	}
	, 1, [null,null,'self']);
	cls_definition.__len__ = pyjs__bind_method(cls_instance, '__len__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var size=0;
        for (var i in this.d) size++;
        return size;
        
	}
	, 1, [null,null,'self']);
	cls_definition.has_key = pyjs__bind_method(cls_instance, 'has_key', function(key) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
		}

		return self.__contains__(key);
	}
	, 1, [null,null,'self', 'key']);
	cls_definition.__delitem__ = pyjs__bind_method(cls_instance, '__delitem__', function(key) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
		}


        var sKey = pyjslib.hash(key);
        delete this.d[sKey];
        
	}
	, 1, [null,null,'self', 'key']);
	cls_definition.__contains__ = pyjs__bind_method(cls_instance, '__contains__', function(key) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
		}


        var sKey = pyjslib.hash(key);
        return (pyjslib.isUndefined(this.d[sKey])) ? false : true;
        
	}
	, 1, [null,null,'self', 'key']);
	cls_definition.keys = pyjs__bind_method(cls_instance, 'keys', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var keys=new pyjslib.List();
        for (var key in this.d) {
            keys.append(this.d[key][0]);
        }
        return keys;
        
	}
	, 1, [null,null,'self']);
	cls_definition.values = pyjs__bind_method(cls_instance, 'values', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var values=new pyjslib.List();
        for (var key in this.d) values.append(this.d[key][1]);
        return values;
        
	}
	, 1, [null,null,'self']);
	cls_definition.items = pyjs__bind_method(cls_instance, 'items', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var items = new pyjslib.List();
        for (var key in this.d) {
          var kv = this.d[key];
          items.append(new pyjslib.List(kv));
          }
          return items;
        
	}
	, 1, [null,null,'self']);
	cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.keys().__iter__();
	}
	, 1, [null,null,'self']);
	cls_definition.iterkeys = pyjs__bind_method(cls_instance, 'iterkeys', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.__iter__();
	}
	, 1, [null,null,'self']);
	cls_definition.itervalues = pyjs__bind_method(cls_instance, 'itervalues', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.values().__iter__();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.iteritems = pyjs__bind_method(cls_instance, 'iteritems', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.items().__iter__();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.setdefault = pyjs__bind_method(cls_instance, 'setdefault', function(key, default_value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
			default_value = arguments[2];
		}

		if (pyjslib.bool(!(self.has_key(key)))) {
			self.__setitem__(key, default_value);
		}
		return self.__getitem__(key);
	}
	, 1, [null,null,'self', 'key', 'default_value']);
	cls_definition.get = pyjs__bind_method(cls_instance, 'get', function(key, default_value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
			default_value = arguments[2];
		}
		if (typeof default_value == 'undefined') default_value=null;

		if (pyjslib.bool(!(self.has_key(key)))) {
			return default_value;
		}
		return self.__getitem__(key);
	}
	, 1, [null,null,'self', 'key', 'default_value']);
	cls_definition.update = pyjs__bind_method(cls_instance, 'update', function(d) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			d = arguments[1];
		}
		var k,temp_k,v;
		var __temp_k = d.iteritems().__iter__();
		try {
			while (true) {
				var temp_k = __temp_k.next();
						var k = temp_k.__getitem__(0);		var v = temp_k.__getitem__(1);
				self.__setitem__(k, v);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'd']);
	cls_definition.pop = pyjs__bind_method(cls_instance, 'pop', function(k) {
		if (this.__is_instance__ === true) {
			var self = this;
			var d = new Array();
			for (var pyjs__va_arg = 1; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
				var pyjs__arg = arguments[pyjs__va_arg];
				d.push(pyjs__arg);
			}
			d = pyjslib.Tuple(d);

		} else {
			var self = arguments[0];
			k = arguments[1];
			var d = new Array();
			for (var pyjs__va_arg = 2; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
				var pyjs__arg = arguments[pyjs__va_arg];
				d.push(pyjs__arg);
			}
			d = pyjslib.Tuple(d);

		}
		var err,res,pyjs_try_err;
		if (pyjslib.bool((pyjslib.cmp(pyjslib.len(d), 1) == 1))) {
			throw (pyjslib.TypeError(pyjslib.sprintf(String('pop expected at most 2 arguments, got %s'),  ( 1 + pyjslib.len(d) ) )));
		}
		try {
			res = self.__getitem__(k);
    self.__delitem__(k);
			return res;
		} catch(pyjs_try_err) {
			var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
			$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjslib, try_lineno: 1101};
			if (pyjs_try_err_name == pyjslib.KeyError.__name__) {
				$pyjs.__last_exception__.except_lineno = 1105;
				err = pyjs_try_err;
				if (pyjslib.bool(d)) {
					return d.__getitem__(0);
				}
				else {
					throw ($pyjs.__last_exception__?$pyjs.__last_exception__.error:pyjslib.TypeError('exceptions must be classes, instances, or strings (deprecated), not NoneType'));
				}
			} else { throw pyjs_try_err; }
		}
		return null;
	}
	, 1, ['d',null,'self', 'k']);
	cls_definition.popitem = pyjs__bind_method(cls_instance, 'popitem', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var k,temp_k,v;
		var __temp_k = self.iteritems().__iter__();
		try {
			while (true) {
				var temp_k = __temp_k.next();
						var k = temp_k.__getitem__(0);		var v = temp_k.__getitem__(1);
				break;
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
    self.__delitem__(k);
		return new pyjslib.Tuple([k, v]);
	}
	, 1, [null,null,'self']);
	cls_definition.getObject = pyjs__bind_method(cls_instance, 'getObject', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.d;
	}
	, 1, [null,null,'self']);
	cls_definition.copy = pyjs__bind_method(cls_instance, 'copy', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjslib.Dict(self.items());
	}
	, 1, [null,null,'self']);
	cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.__repr__();
	}
	, 1, [null,null,'self']);
	cls_definition.__repr__ = pyjs__bind_method(cls_instance, '__repr__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        var keys = new Array();
        for (var key in self.d)
            keys.push(key);

        var s = "{";
        for (var i=0; i<keys.length; i++) {
            var v = self.d[keys[i]];
            s += pyjslib.repr(v[0]) + ": " + pyjslib.repr(v[1]);
            if (i < keys.length-1)
                s += ", ";
        }
        s += "}";
        return s;
        
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjslib.dict = pyjslib.Dict;
pyjslib._super = function(type_, object_or_type) {
	if (typeof object_or_type == 'undefined') object_or_type=null;

	if (pyjslib.bool(!(pyjslib._issubtype(object_or_type, type_)))) {
		throw (pyjslib.TypeError(String('super(type, obj): obj must be an instance or subtype of type')));
	}

    var fn = pyjs_type('super', type_.__mro__.slice(1), {});
    fn.__new__ = fn.__mro__[1].__new__;
    fn.__init__ = fn.__mro__[1].__init__;
    if (object_or_type.__is_instance__ === false) {
        return fn;
    }
    var obj = new Object();
    function wrapper(obj, name) {
        var fnwrap = function() {
            var args = [];
            for (var i = 0; i < arguments.length; i++) {
              args.push(arguments[i]);
            }
            return obj[name].apply(object_or_type,args);
        };
        fnwrap.__name__ = name;
    	fnwrap.__args__ = obj.__args__;
    	fnwrap.__bind_type__ = obj.__bind_type__;
        return fnwrap;
    }
    for (var m in fn) {
        if (typeof fn[m] == 'function') {
            obj[m] = wrapper(fn, m);
        }
    }
    return obj;
    
};
pyjslib._super.__name__ = '_super';

pyjslib._super.__bind_type__ = 0;
pyjslib._super.__args__ = [null,null,'type_', 'object_or_type'];
pyjslib.range = function(start, stop, step) {
	if (typeof stop == 'undefined') stop=null;
	if (typeof step == 'undefined') step=1;

	if (pyjslib.bool((stop === null))) {
		stop = start;
		start = 0;
	}

    return {
        'next': function() {
            if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) throw pyjslib.StopIteration;
            var rval = start;
            start += step;
            return rval;
            },
        '__iter__': function() {
            return this;
            }
        };
    
};
pyjslib.range.__name__ = 'range';

pyjslib.range.__bind_type__ = 0;
pyjslib.range.__args__ = [null,null,'start', 'stop', 'step'];
pyjslib.slice = function(object, lower, upper) {


    if (pyjslib.isString(object)) {
        if (lower < 0) {
           lower = object.length + lower;
        }
        if (upper < 0) {
           upper = object.length + upper;
        }
        if (pyjslib.isNull(upper)) upper=object.length;
        return object.substring(lower, upper);
    }
    if (pyjslib.isObject(object) && object.slice)
        return object.slice(lower, upper);

    return null;
    
};
pyjslib.slice.__name__ = 'slice';

pyjslib.slice.__bind_type__ = 0;
pyjslib.slice.__args__ = [null,null,'object', 'lower', 'upper'];
pyjslib.str = function(text) {


    if (pyjslib.hasattr(text,"__str__")) {
        return text.__str__();
    }
    return String(text);
    
};
pyjslib.str.__name__ = 'str';

pyjslib.str.__bind_type__ = 0;
pyjslib.str.__args__ = [null,null,'text'];
pyjslib.ord = function(x) {

	if (pyjslib.bool((pyjslib.isString(x)) && ((pyjslib.len(x) === 1)))) {

            return x.charCodeAt(0);
        
	}
	else {

            throw pyjslib.TypeError();
        
	}
	return null;
};
pyjslib.ord.__name__ = 'ord';

pyjslib.ord.__bind_type__ = 0;
pyjslib.ord.__args__ = [null,null,'x'];
pyjslib.chr = function(x) {


        return String.fromCharCode(x);
    
};
pyjslib.chr.__name__ = 'chr';

pyjslib.chr.__bind_type__ = 0;
pyjslib.chr.__args__ = [null,null,'x'];
pyjslib.is_basetype = function(x) {


       var t = typeof(x);
       return t == 'boolean' ||
       t == 'function' ||
       t == 'number' ||
       t == 'string' ||
       t == 'undefined';
    
};
pyjslib.is_basetype.__name__ = 'is_basetype';

pyjslib.is_basetype.__bind_type__ = 0;
pyjslib.is_basetype.__args__ = [null,null,'x'];
pyjslib.get_pyjs_classtype = function(x) {


        if (pyjslib.hasattr(x, "__is_instance__")) {
            var src = x.__name__;
            return src;
        }
        return null;
    
};
pyjslib.get_pyjs_classtype.__name__ = 'get_pyjs_classtype';

pyjslib.get_pyjs_classtype.__bind_type__ = 0;
pyjslib.get_pyjs_classtype.__args__ = [null,null,'x'];
pyjslib.repr = function(x) {

	if (pyjslib.bool(pyjslib.hasattr(x, String('__repr__')))) {
		return x.__repr__();
	}

       if (x === null)
           return "null";

       if (x === undefined)
           return "undefined";

       var t = typeof(x);

        //alert("repr typeof " + t + " : " + x);

       if (t == "boolean")
           return x.toString();

       if (t == "function")
           return "<function " + x.toString() + ">";

       if (t == "number")
           return x.toString();

       if (t == "string") {
           if (x.indexOf("'") == -1)
               return "'" + x + "'";
           if (x.indexOf('"') == -1)
               return '"' + x + '"';
           var s = x.replace(new RegExp('"', "g"), '\\"');
           return '"' + s + '"';
       }

       if (t == "undefined")
           return "undefined";

       // If we get here, x is an object.  See if it's a Pyjamas class.

       if (!pyjslib.hasattr(x, "__init__"))
           return "<" + x.toString() + ">";

       // Handle the common Pyjamas data types.

       var constructor = "UNKNOWN";

       constructor = pyjslib.get_pyjs_classtype(x);

        //alert("repr constructor: " + constructor);

       // If we get here, the class isn't one we know -> return the class name.
       // Note that we replace underscores with dots so that the name will
       // (hopefully!) look like the original Python name.

       //var s = constructor.replace(new RegExp('_', "g"), '.');
       return "<" + constructor + " object>";
    
};
pyjslib.repr.__name__ = 'repr';

pyjslib.repr.__bind_type__ = 0;
pyjslib.repr.__args__ = [null,null,'x'];
pyjslib.float_ = function(text) {


    return parseFloat(text);
    
};
pyjslib.float_.__name__ = 'float_';

pyjslib.float_.__bind_type__ = 0;
pyjslib.float_.__args__ = [null,null,'text'];
pyjslib.int_ = function(text, radix) {
	if (typeof radix == 'undefined') radix=null;
	var _radix;
	_radix = radix;

    if (radix === null) {
        _radix = 10
    } else {
        if (typeof text != 'string') {
            throw pyjslib.TypeError("int() can't convert non-string with explicit base");
        }
    }
    var i = parseInt(text, _radix);
    if (!isNaN(i)) {
        return i;
    }
    
	throw (pyjslib.ValueError(pyjslib.sprintf(String('invalid literal for int() with base %d: \x27%s\x27'), new pyjslib.Tuple([_radix, text]))));
	return null;
};
pyjslib.int_.__name__ = 'int_';

pyjslib.int_.__bind_type__ = 0;
pyjslib.int_.__args__ = [null,null,'text', 'radix'];
pyjslib.len = function(object) {


    if (typeof object.__len__ == 'function') return object.__len__();
    if (typeof object.length != 'undefined') return object.length;
    if (object === null) return 0;
    throw pyjslib.TypeError("object has no len()")
    
};
pyjslib.len.__name__ = 'len';

pyjslib.len.__bind_type__ = 0;
pyjslib.len.__args__ = [null,null,'object'];
pyjslib.isinstance = function(object_, classinfo) {
	var ci;
	if (pyjslib.bool(pyjslib.isUndefined(object_))) {
		return false;
	}
if (classinfo.__name__ == 'int_') {
            return pyjslib.isNumber(object_); /* XXX TODO: check rounded? */
            }
        
if (classinfo.__name__ == 'str') {
            return pyjslib.isString(object_);
            }
        
	if (pyjslib.bool(!(pyjslib.isObject(object_)))) {
		return false;
	}
	if (pyjslib.bool(pyjslib._isinstance(classinfo, pyjslib.Tuple))) {
		var __ci = classinfo.__iter__();
		try {
			while (true) {
				var ci = __ci.next();
				
				if (pyjslib.bool(pyjslib.isinstance(object_, ci))) {
					return true;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return false;
	}
	else {
		return pyjslib._isinstance(object_, classinfo);
	}
	return null;
};
pyjslib.isinstance.__name__ = 'isinstance';

pyjslib.isinstance.__bind_type__ = 0;
pyjslib.isinstance.__args__ = [null,null,'object_', 'classinfo'];
pyjslib._isinstance = function(object_, classinfo) {


    if (object_.__is_instance__ !== true) {
        return false;
    }
    for (var c in object_.__mro__) {
        if (object_.__mro__[c].__md5__ == classinfo.prototype.__md5__) return true;
    }
    return false;
    
};
pyjslib._isinstance.__name__ = '_isinstance';

pyjslib._isinstance.__bind_type__ = 0;
pyjslib._isinstance.__args__ = [null,null,'object_', 'classinfo'];
pyjslib._issubtype = function(object_, classinfo) {


    if (object_.__is_instance__ == null || classinfo.__is_instance__ == null) {
        return false;
    }
    for (var c in object_.__mro__) {
        if (object_.__mro__[c] == classinfo.prototype) return true;
    }
    return false;
    
};
pyjslib._issubtype.__name__ = '_issubtype';

pyjslib._issubtype.__bind_type__ = 0;
pyjslib._issubtype.__args__ = [null,null,'object_', 'classinfo'];
pyjslib.getattr = function(obj, name, default_value) {
	if (typeof default_value == 'undefined') default_value=null;


    if ((!pyjslib.isObject(obj))||(pyjslib.isUndefined(obj[name]))){
        if (arguments.length != 3){
            throw pyjslib.AttributeError(obj, name);
        }else{
        return default_value;
        }
    }
    if (!pyjslib.isFunction(obj[name])) return obj[name];
    var method = obj[name];
    var fnwrap = function() {
        var args = [];
        for (var i = 0; i < arguments.length; i++) {
          args.push(arguments[i]);
        }
        return method.apply(obj,args);
    };
    fnwrap.__name__ = name;
    fnwrap.__args__ = obj.__args__;
    fnwrap.__bind_type__ = obj.__bind_type__;
    return fnwrap;
    
};
pyjslib.getattr.__name__ = 'getattr';

pyjslib.getattr.__bind_type__ = 0;
pyjslib.getattr.__args__ = [null,null,'obj', 'name', 'default_value'];
pyjslib.delattr = function(obj, name) {


    if (!pyjslib.isObject(obj)) {
       throw pyjslib.AttributeError("'"+typeof(obj)+"' object has no attribute '"+name+"%s'")
    }
    if ((pyjslib.isUndefined(obj[name])) ||(typeof(obj[name]) == "function") ){
        throw pyjslib.AttributeError(obj.__name__+" instance has no attribute '"+ name+"'");
    }
    delete obj[name];
    
};
pyjslib.delattr.__name__ = 'delattr';

pyjslib.delattr.__bind_type__ = 0;
pyjslib.delattr.__args__ = [null,null,'obj', 'name'];
pyjslib.setattr = function(obj, name, value) {


    if (!pyjslib.isObject(obj)) return null;

    obj[name] = value;

    
};
pyjslib.setattr.__name__ = 'setattr';

pyjslib.setattr.__bind_type__ = 0;
pyjslib.setattr.__args__ = [null,null,'obj', 'name', 'value'];
pyjslib.hasattr = function(obj, name) {


    if (!pyjslib.isObject(obj)) return false;
    if (pyjslib.isUndefined(obj[name])) return false;

    return true;
    
};
pyjslib.hasattr.__name__ = 'hasattr';

pyjslib.hasattr.__bind_type__ = 0;
pyjslib.hasattr.__args__ = [null,null,'obj', 'name'];
pyjslib.dir = function(obj) {


    var properties=new pyjslib.List();
    for (property in obj) properties.append(property);
    return properties;
    
};
pyjslib.dir.__name__ = 'dir';

pyjslib.dir.__bind_type__ = 0;
pyjslib.dir.__args__ = [null,null,'obj'];
pyjslib.filter = function(obj, method, sequence) {
	if (typeof sequence == 'undefined') sequence=null;
	var items,item;
	items = new pyjslib.List([]);
	if (pyjslib.bool((sequence === null))) {
		sequence = method;
		method = obj;
		var __item = sequence.__iter__();
		try {
			while (true) {
				var item = __item.next();
				
				if (pyjslib.bool(method(item))) {
					items.append(item);
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	else {
		var __item = sequence.__iter__();
		try {
			while (true) {
				var item = __item.next();
				
				if (pyjslib.bool(method.call_(obj, item))) {
					items.append(item);
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	return items;
};
pyjslib.filter.__name__ = 'filter';

pyjslib.filter.__bind_type__ = 0;
pyjslib.filter.__args__ = [null,null,'obj', 'method', 'sequence'];
pyjslib.map = function(obj, method, sequence) {
	if (typeof sequence == 'undefined') sequence=null;
	var items,item;
	items = new pyjslib.List([]);
	if (pyjslib.bool((sequence === null))) {
		sequence = method;
		method = obj;
		var __item = sequence.__iter__();
		try {
			while (true) {
				var item = __item.next();
				
				items.append(method(item));
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	else {
		var __item = sequence.__iter__();
		try {
			while (true) {
				var item = __item.next();
				
				items.append(method.call_(obj, item));
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	return items;
};
pyjslib.map.__name__ = 'map';

pyjslib.map.__bind_type__ = 0;
pyjslib.map.__args__ = [null,null,'obj', 'method', 'sequence'];
pyjslib.enumerate = function(sequence) {
	var item,nextIndex,enumeration;
	enumeration = new pyjslib.List([]);
	nextIndex = 0;
	var __item = sequence.__iter__();
	try {
		while (true) {
			var item = __item.next();
			
			enumeration.append(new pyjslib.List([nextIndex, item]));
			nextIndex =  ( nextIndex + 1 ) ;
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return enumeration;
};
pyjslib.enumerate.__name__ = 'enumerate';

pyjslib.enumerate.__bind_type__ = 0;
pyjslib.enumerate.__args__ = [null,null,'sequence'];
pyjslib.min = function() {
	var sequence = new Array();
	for (var pyjs__va_arg = 0; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
		var pyjs__arg = arguments[pyjs__va_arg];
		sequence.push(pyjs__arg);
	}
	sequence = pyjslib.Tuple(sequence);

	var item,minValue;
	if (pyjslib.bool(pyjslib.eq(pyjslib.len(sequence), 1))) {
		sequence = sequence.__getitem__(0);
	}
	minValue = null;
	var __item = sequence.__iter__();
	try {
		while (true) {
			var item = __item.next();
			
			if (pyjslib.bool((minValue === null))) {
				minValue = item;
			}
			else if (pyjslib.bool(pyjslib.eq(pyjslib.cmp(item, minValue), -1))) {
				minValue = item;
			}
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return minValue;
};
pyjslib.min.__name__ = 'min';

pyjslib.min.__bind_type__ = 0;
pyjslib.min.__args__ = ['sequence',null];
pyjslib.max = function() {
	var sequence = new Array();
	for (var pyjs__va_arg = 0; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
		var pyjs__arg = arguments[pyjs__va_arg];
		sequence.push(pyjs__arg);
	}
	sequence = pyjslib.Tuple(sequence);

	var item,maxValue;
	if (pyjslib.bool(pyjslib.eq(pyjslib.len(sequence), 1))) {
		sequence = sequence.__getitem__(0);
	}
	maxValue = null;
	var __item = sequence.__iter__();
	try {
		while (true) {
			var item = __item.next();
			
			if (pyjslib.bool((maxValue === null))) {
				maxValue = item;
			}
			else if (pyjslib.bool(pyjslib.eq(pyjslib.cmp(item, maxValue), 1))) {
				maxValue = item;
			}
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return maxValue;
};
pyjslib.max.__name__ = 'max';

pyjslib.max.__bind_type__ = 0;
pyjslib.max.__args__ = ['sequence',null];
pyjslib.next_hash_id = 0;
pyjslib.hash = function(obj) {


    if (obj == null) return null;

    if (obj.$H) return obj.$H;
    if (obj.__hash__) return obj.__hash__();
    if (obj.constructor == String || obj.constructor == Number || obj.constructor == Date) return obj;

    try {
        obj.$H = ++pyjslib.next_hash_id;
        return obj.$H;
    } catch (e) {
        return obj;
    }
    
};
pyjslib.hash.__name__ = 'hash';

pyjslib.hash.__bind_type__ = 0;
pyjslib.hash.__args__ = [null,null,'obj'];
pyjslib.isObject = function(a) {


    return (a != null && (typeof a == 'object')) || pyjslib.isFunction(a);
    
};
pyjslib.isObject.__name__ = 'isObject';

pyjslib.isObject.__bind_type__ = 0;
pyjslib.isObject.__args__ = [null,null,'a'];
pyjslib.isFunction = function(a) {


    return typeof a == 'function';
    
};
pyjslib.isFunction.__name__ = 'isFunction';

pyjslib.isFunction.__bind_type__ = 0;
pyjslib.isFunction.__args__ = [null,null,'a'];
pyjslib.callable = pyjslib.isFunction;
pyjslib.isString = function(a) {


    return typeof a == 'string';
    
};
pyjslib.isString.__name__ = 'isString';

pyjslib.isString.__bind_type__ = 0;
pyjslib.isString.__args__ = [null,null,'a'];
pyjslib.isNull = function(a) {


    return typeof a == 'object' && !a;
    
};
pyjslib.isNull.__name__ = 'isNull';

pyjslib.isNull.__bind_type__ = 0;
pyjslib.isNull.__args__ = [null,null,'a'];
pyjslib.isArray = function(a) {


    return pyjslib.isObject(a) && a.constructor == Array;
    
};
pyjslib.isArray.__name__ = 'isArray';

pyjslib.isArray.__bind_type__ = 0;
pyjslib.isArray.__args__ = [null,null,'a'];
pyjslib.isUndefined = function(a) {


    return typeof a == 'undefined';
    
};
pyjslib.isUndefined.__name__ = 'isUndefined';

pyjslib.isUndefined.__bind_type__ = 0;
pyjslib.isUndefined.__args__ = [null,null,'a'];
pyjslib.isIteratable = function(a) {


    return pyjslib.isString(a) || (pyjslib.isObject(a) && a.__iter__);
    
};
pyjslib.isIteratable.__name__ = 'isIteratable';

pyjslib.isIteratable.__bind_type__ = 0;
pyjslib.isIteratable.__args__ = [null,null,'a'];
pyjslib.isNumber = function(a) {


    return typeof a == 'number' && isFinite(a);
    
};
pyjslib.isNumber.__name__ = 'isNumber';

pyjslib.isNumber.__bind_type__ = 0;
pyjslib.isNumber.__args__ = [null,null,'a'];
pyjslib.toJSObjects = function(x) {

	if (pyjslib.bool(pyjslib.isArray(x))) {

        var result = [];
        for(var k=0; k < x.length; k++) {
           var v = x[k];
           var tv = pyjslib.toJSObjects(v);
           result.push(tv);
        }
        return result;
        
	}
	if (pyjslib.bool(pyjslib.isObject(x))) {
		if (pyjslib.bool(pyjslib.isinstance(x, pyjslib.Dict))) {

            var o = x.getObject();
            var result = {};
            for (var i in o) {
               result[o[i][0].toString()] = o[i][1];
            }
            return pyjslib.toJSObjects(result)
            
		}
		else if (pyjslib.bool(pyjslib.isinstance(x, pyjslib.List))) {
			return pyjslib.toJSObjects(x.l);
		}
		else if (pyjslib.bool(pyjslib.hasattr(x, String('__class__')))) {
			return x;
		}
	}
	if (pyjslib.bool(pyjslib.isObject(x))) {

        var result = {};
        for(var k in x) {
            var v = x[k];
            var tv = pyjslib.toJSObjects(v);
            result[k] = tv;
            }
            return result;
         
	}
	return x;
};
pyjslib.toJSObjects.__name__ = 'toJSObjects';

pyjslib.toJSObjects.__bind_type__ = 0;
pyjslib.toJSObjects.__args__ = [null,null,'x'];
pyjslib.sprintf = function(strng, args) {
	var a,sprintf_dict,next_arg,remainder,nargs,argidx,formatarg,result,constructor,strlen,sprintf_list;
	constructor = pyjslib.get_pyjs_classtype(args);

    var re_dict = /([^%]*)%[(]([^)]+)[)]([#0  x2B-]*)(\d+)?(\.\d+)?[hlL]?(.)((.|\n)*)/;
    var re_list = /([^%]*)%([#0 +-]*)(\*|(\d+))?(\.\d+)?[hlL]?(.)((.|\n)*)/;
    var re_exp = /(.*)([+-])(.*)/;

	strlen = pyjslib.len(strng);
	argidx = 0;
	nargs = 0;
	result = new pyjslib.List([]);
	remainder = strng;
	next_arg = function() {
		var arg;
		if (pyjslib.bool(pyjslib.eq(argidx, nargs))) {
			throw (pyjslib.TypeError(String('not enough arguments for format string')));
		}
		arg = args.__getitem__(argidx);
		argidx += 1;
		return arg;
	};
	next_arg.__name__ = 'next_arg';

	next_arg.__bind_type__ = 0;
	next_arg.__args__ = [null,null];
	formatarg = function(flags, minlen, precision, conversion, param) {
		var subst,numeric,padchar,left_padding;
		subst = String('');
		numeric = true;
		if (pyjslib.bool(!(minlen))) {
			minlen = 0;
		}
		else {
			minlen = pyjslib.int_(minlen);
		}
		if (pyjslib.bool(!(precision))) {
			precision = null;
		}
		else {
			precision = pyjslib.int_(precision);
		}
		left_padding = 1;
		if (pyjslib.bool((pyjslib.cmp(flags.find(String('-')), 0) != -1))) {
			left_padding = 0;
		}
		if (pyjslib.bool(pyjslib.eq(conversion, String('%')))) {
			numeric = false;
			subst = String('%');
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('c')))) {
			numeric = false;
			subst = pyjslib.chr(pyjslib.int_(param));
		}
		else if (pyjslib.bool((pyjslib.eq(conversion, String('d'))) || (pyjslib.eq(conversion, String('i'))) || (pyjslib.eq(conversion, String('u'))))) {
			subst = pyjslib.str(pyjslib.int_(param));
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('e')))) {
			if (pyjslib.bool((precision === null))) {
				precision = 6;
			}

            subst = re_exp.exec(String(param.toExponential(precision)));
            if (subst[3].length == 1) {
                subst = subst[1] + subst[2] + '0' + subst[3];
            } else {
                subst = subst[1] + subst[2] + subst[3];
            }
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('E')))) {
			if (pyjslib.bool((precision === null))) {
				precision = 6;
			}

            subst = re_exp.exec(String(param.toExponential(precision)).toUpperCase());
            if (subst[3].length == 1) {
                subst = subst[1] + subst[2] + '0' + subst[3];
            } else {
                subst = subst[1] + subst[2] + subst[3];
            }
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('f')))) {
			if (pyjslib.bool((precision === null))) {
				precision = 6;
			}

            subst = String(parseFloat(param).toFixed(precision));
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('F')))) {
			if (pyjslib.bool((precision === null))) {
				precision = 6;
			}

            subst = String(parseFloat(param).toFixed(precision)).toUpperCase();
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('g')))) {
			if (pyjslib.bool((pyjslib.cmp(flags.find(String('#')), 0) != -1))) {
				if (pyjslib.bool((precision === null))) {
					precision = 6;
				}
			}
			if (pyjslib.bool(((pyjslib.cmp(param, 1000000.0) != -1)) || ((pyjslib.cmp(param, 1e-05) == -1)))) {

                subst = String(precision == null ? param.toExponential() : param.toExponential().toPrecision(precision));
			}
			else {

                subst = String(precision == null ? parseFloat(param) : parseFloat(param).toPrecision(precision));
			}
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('G')))) {
			if (pyjslib.bool((pyjslib.cmp(flags.find(String('#')), 0) != -1))) {
				if (pyjslib.bool((precision === null))) {
					precision = 6;
				}
			}
			if (pyjslib.bool(((pyjslib.cmp(param, 1000000.0) != -1)) || ((pyjslib.cmp(param, 1e-05) == -1)))) {

                subst = String(precision == null ? param.toExponential() : param.toExponential().toPrecision(precision)).toUpperCase();
			}
			else {

                subst = String(precision == null ? parseFloat(param) : parseFloat(param).toPrecision(precision)).toUpperCase().toUpperCase();
			}
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('r')))) {
			numeric = false;
			subst = pyjslib.repr(param);
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('s')))) {
			numeric = false;
			subst = pyjslib.str(param);
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('o')))) {
			param = pyjslib.int_(param);

            subst = param.toString(8);
			if (pyjslib.bool(((pyjslib.cmp(flags.find(String('#')), 0) != -1)) && (!pyjslib.eq(subst, String('0'))))) {
				subst =  ( String('0') + subst ) ;
			}
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('x')))) {
			param = pyjslib.int_(param);

            subst = param.toString(16);
			if (pyjslib.bool((pyjslib.cmp(flags.find(String('#')), 0) != -1))) {
				if (pyjslib.bool(left_padding)) {
					subst = subst.rjust( ( minlen - 2 ) , String('0'));
				}
				subst =  ( String('0x') + subst ) ;
			}
		}
		else if (pyjslib.bool(pyjslib.eq(conversion, String('X')))) {
			param = pyjslib.int_(param);

            subst = param.toString(16).toUpperCase();
			if (pyjslib.bool((pyjslib.cmp(flags.find(String('#')), 0) != -1))) {
				if (pyjslib.bool(left_padding)) {
					subst = subst.rjust( ( minlen - 2 ) , String('0'));
				}
				subst =  ( String('0X') + subst ) ;
			}
		}
		else {
			throw (pyjslib.ValueError( (  (  (  (  ( String('unsupported format character \x27') + conversion )  + String('\x27 (') )  + pyjslib.hex(pyjslib.ord(conversion)) )  + String(') at index ') )  +  (  ( strlen - pyjslib.len(remainder) )  - 1 )  ) ));
		}
		if (pyjslib.bool((minlen) && ((pyjslib.cmp(pyjslib.len(subst), minlen) == -1)))) {
			padchar = String(' ');
			if (pyjslib.bool((numeric) && (left_padding) && ((pyjslib.cmp(flags.find(String('0')), 0) != -1)))) {
				padchar = String('0');
			}
			if (pyjslib.bool(left_padding)) {
				subst = subst.rjust(minlen, padchar);
			}
			else {
				subst = subst.ljust(minlen, padchar);
			}
		}
		return subst;
	};
	formatarg.__name__ = 'formatarg';

	formatarg.__bind_type__ = 0;
	formatarg.__args__ = [null,null,'flags', 'minlen', 'precision', 'conversion', 'param'];
	sprintf_list = function(strng, args) {
		var a,conversion,minlen,precision,param,flags,minlen_type,left;
		a = null;
		left = null;
		flags = null;
		precision = null;
		conversion = null;
		minlen = null;
		minlen_type = null;
    while (pyjslib.bool(remainder)) {

            a = re_list.exec(remainder);
		if (pyjslib.bool((a === null))) {
			result.append(remainder);
			break;
		}

            left = a[1], flags = a[2];
            minlen = a[3], precision = a[5], conversion = a[6];
            remainder = a[7];
            if (typeof minlen == 'undefined') minlen = null;
            if (typeof precision == 'undefined') precision = null;
            if (typeof conversion == 'undefined') conversion = null;

		result.append(left);
		if (pyjslib.bool(pyjslib.eq(minlen, String('*')))) {
			minlen = next_arg();
minlen_type = typeof(minlen);
			if (pyjslib.bool((!pyjslib.eq(minlen_type, String('number'))) || (!pyjslib.eq(pyjslib.int_(minlen), minlen)))) {
				throw (pyjslib.TypeError(String('* wants int')));
			}
		}
		if (pyjslib.bool(!pyjslib.eq(conversion, String('%')))) {
			param = next_arg();
		}
		result.append(formatarg(flags, minlen, precision, conversion, param));
    }
		return null;
	};
	sprintf_list.__name__ = 'sprintf_list';

	sprintf_list.__bind_type__ = 0;
	sprintf_list.__args__ = [null,null,'strng', 'args'];
	sprintf_dict = function(strng, args) {
		var a,conversion,minlen,precision,param,flags,key,arg,left;
		arg = args;
		argidx += 1;
		a = null;
		key = null;
		left = null;
		flags = null;
		precision = null;
		conversion = null;
		minlen = null;
    while (pyjslib.bool(remainder)) {

            a = re_dict.exec(remainder);
		if (pyjslib.bool((a === null))) {
			result.append(remainder);
			break;
		}

            left = a[1], key = a[2], flags = a[3];
            minlen = a[4], precision = a[5], conversion = a[6];
            remainder = a[7];
            if (typeof minlen == 'undefined') minlen = null;
            if (typeof precision == 'undefined') precision = null;
            if (typeof conversion == 'undefined') conversion = null;

		result.append(left);
		if (pyjslib.bool(!(arg.has_key(key)))) {
			throw (pyjslib.KeyError(key));
		}
		else {
			param = arg.__getitem__(key);
		}
		result.append(formatarg(flags, minlen, precision, conversion, param));
    }
		return null;
	};
	sprintf_dict.__name__ = 'sprintf_dict';

	sprintf_dict.__bind_type__ = 0;
	sprintf_dict.__args__ = [null,null,'strng', 'args'];
	a = null;

    a = re_dict.exec(strng);

	if (pyjslib.bool((a === null))) {
		if (pyjslib.bool(!pyjslib.eq(constructor, String('Tuple')))) {
			args = new pyjslib.Tuple([args]);
		}
		nargs = pyjslib.len(args);
		sprintf_list(strng, args);
		if (pyjslib.bool(!pyjslib.eq(argidx, nargs))) {
			throw (pyjslib.TypeError(String('not all arguments converted during string formatting')));
		}
	}
	else {
		if (pyjslib.bool(!pyjslib.eq(constructor, String('Dict')))) {
			throw (pyjslib.TypeError(String('format requires a mapping')));
		}
		sprintf_dict(strng, args);
	}
	return String('').join(result);
};
pyjslib.sprintf.__name__ = 'sprintf';

pyjslib.sprintf.__bind_type__ = 0;
pyjslib.sprintf.__args__ = [null,null,'strng', 'args'];
pyjslib.printFunc = function(objs, newline) {


    if ($wnd.console==undefined)  return;
    var s = "";
    for(var i=0; i < objs.length; i++) {
        if(s != "") s += " ";
        s += objs[i];
    }
    console.debug(s)
    
};
pyjslib.printFunc.__name__ = 'printFunc';

pyjslib.printFunc.__bind_type__ = 0;
pyjslib.printFunc.__args__ = [null,null,'objs', 'newline'];
pyjslib.type = function(clsname, bases, methods) {
	if (typeof bases == 'undefined') bases=null;
	if (typeof methods == 'undefined') methods=null;
	var k,mth;
 var mths = {}; 
	if (pyjslib.bool(methods)) {
		var __k = methods.keys().__iter__();
		try {
			while (true) {
				var k = __k.next();
				
				mth = methods.__getitem__(k);
 mths[k] = mth; 
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
 var bss = null; 
	if (pyjslib.bool(bases)) {
bss = bases.l;
	}
 return pyjs_type(clsname, bss, mths); 
};
pyjslib.type.__name__ = 'type';

pyjslib.type.__bind_type__ = 0;
pyjslib.type.__args__ = [null,null,'clsname', 'bases', 'methods'];
pyjslib.pow = function(x, y, z) {
	if (typeof z == 'undefined') z=null;
	var p;
	p = null;
p = Math.pow(x, y);
	if (pyjslib.bool((z === null))) {
		return pyjslib.float_(p);
	}
	return pyjslib.float_(p % z);
};
pyjslib.pow.__name__ = 'pow';

pyjslib.pow.__bind_type__ = 0;
pyjslib.pow.__args__ = [null,null,'x', 'y', 'z'];
pyjslib.hex = function(x) {
	var r;
	if (pyjslib.bool(!pyjslib.eq(pyjslib.int_(x), x))) {
		throw (pyjslib.TypeError(String('hex() argument can\x27t be converted to hex')));
	}
	r = null;
r = '0x'+x.toString(16);
	return pyjslib.str(r);
};
pyjslib.hex.__name__ = 'hex';

pyjslib.hex.__bind_type__ = 0;
pyjslib.hex.__args__ = [null,null,'x'];
pyjslib.oct = function(x) {
	var r;
	if (pyjslib.bool(!pyjslib.eq(pyjslib.int_(x), x))) {
		throw (pyjslib.TypeError(String('oct() argument can\x27t be converted to oct')));
	}
	r = null;
r = '0'+x.toString(8);
	return pyjslib.str(r);
};
pyjslib.oct.__name__ = 'oct';

pyjslib.oct.__bind_type__ = 0;
pyjslib.oct.__args__ = [null,null,'x'];
pyjslib.round = function(x, n) {
	if (typeof n == 'undefined') n=0;
	var r;
	n = pyjslib.pow(10, n);
	r = null;
r = Math.round(n*x)/n;
	return pyjslib.float_(r);
};
pyjslib.round.__name__ = 'round';

pyjslib.round.__bind_type__ = 0;
pyjslib.round.__args__ = [null,null,'x', 'n'];
pyjslib.divmod = function(x, y) {
	var f;
	if (pyjslib.bool((pyjslib.eq(pyjslib.int_(x), x)) && (pyjslib.eq(pyjslib.int_(y), y)))) {
		return new pyjslib.Tuple([pyjslib.int_( ( x / y ) ), pyjslib.int_(x % y)]);
	}
	f = null;
f = Math.floor(x / y);
	f = pyjslib.float_(f);
	return new pyjslib.Tuple([f,  ( x -  ( f * y )  ) ]);
};
pyjslib.divmod.__name__ = 'divmod';

pyjslib.divmod.__bind_type__ = 0;
pyjslib.divmod.__args__ = [null,null,'x', 'y'];
pyjslib.all = function(iterable) {
	var element;
	var __element = iterable.__iter__();
	try {
		while (true) {
			var element = __element.next();
			
			if (pyjslib.bool(!(element))) {
				return false;
			}
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return true;
};
pyjslib.all.__name__ = 'all';

pyjslib.all.__bind_type__ = 0;
pyjslib.all.__args__ = [null,null,'iterable'];
pyjslib.any = function(iterable) {
	var element;
	var __element = iterable.__iter__();
	try {
		while (true) {
			var element = __element.next();
			
			if (pyjslib.bool(element)) {
				return true;
			}
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return false;
};
pyjslib.any.__name__ = 'any';

pyjslib.any.__bind_type__ = 0;
pyjslib.any.__args__ = [null,null,'iterable'];
pyjslib.init();
pyjslib.__import__(['sys'], 'sys', 'pyjslib');
pyjslib.sys = $pyjs.__modules__.sys;
return this;
}; /* end pyjslib */
$pyjs.modules_hash['pyjslib'] = $pyjs.loaded_modules['pyjslib'];


 /* end module: pyjslib */


/*
PYJS_DEPS: ['sys']
*/

/* start module: sys */
var sys = $pyjs.loaded_modules["sys"] = function (__mod_name__) {
if(sys.__was_initialized__) return sys;
sys.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'sys';
var __name__ = sys.__name__ = __mod_name__;
sys.overrides = null;
sys.loadpath = null;
sys.stacktrace = null;
sys.appname = null;
sys.setloadpath = function(lp) {

	sys.loadpath = lp;
	return null;
};
sys.setloadpath.__name__ = 'setloadpath';

sys.setloadpath.__bind_type__ = 0;
sys.setloadpath.__args__ = [null,null,'lp'];
sys.setappname = function(an) {

	sys.appname = an;
	return null;
};
sys.setappname.__name__ = 'setappname';

sys.setappname.__bind_type__ = 0;
sys.setappname.__args__ = [null,null,'an'];
sys.getloadpath = function() {

	return sys.loadpath;
};
sys.getloadpath.__name__ = 'getloadpath';

sys.getloadpath.__bind_type__ = 0;
sys.getloadpath.__args__ = [null,null];
sys.addoverride = function(module_name, path) {

	sys.overrides.__setitem__(module_name, path);
	return null;
};
sys.addoverride.__name__ = 'addoverride';

sys.addoverride.__bind_type__ = 0;
sys.addoverride.__args__ = [null,null,'module_name', 'path'];
sys.exc_info = function() {
	var le,cls;
	le = $pyjs.__last_exception__;
	if (pyjslib.bool(!(le))) {
		return new pyjslib.Tuple([null, null, null]);
	}
	if (pyjslib.bool(!(pyjslib.hasattr(le.error, String('__class__'))))) {
		cls = null;
	}
	else {
		cls = le.error.__class__;
	}
	return new pyjslib.Tuple([cls, le.error, null]);
};
sys.exc_info.__name__ = 'exc_info';

sys.exc_info.__bind_type__ = 0;
sys.exc_info.__args__ = [null,null];
sys.exc_clear = function() {

$pyjs.__last_exception__ = null;
};
sys.exc_clear.__name__ = 'exc_clear';

sys.exc_clear.__bind_type__ = 0;
sys.exc_clear.__args__ = [null,null];
sys.save_exception_stack = function () {
    var save_stack = [];
    for (var needle in $pyjs.trackstack) {
        var t = new Object();
        for (var p in $pyjs.trackstack[needle]) {
            t[p] = $pyjs.trackstack[needle][p];
        }
        save_stack.push(t);
        $pyjs.__last_exception_stack__ = save_stack;
    }
return null;
}
sys.trackstackstr = function(stack) {
	if (typeof stack == 'undefined') stack=null;
	var msg,s,stackstrings;
	if (pyjslib.bool((stack === null))) {
		stack = $pyjs.__last_exception_stack__;
	}
	if (pyjslib.bool(!(stack))) {
		return String('');
	}
	stackstrings = new pyjslib.List([]);
	msg = String('');
	var __s = pyjslib.list(stack).__iter__();
	try {
		while (true) {
			var s = __s.next();
			
msg = eval(s.module + '.__track_lines__[' + s.lineno + ']');
			if (pyjslib.bool(msg)) {
				stackstrings.append(msg);
			}
			else {
				stackstrings.append(pyjslib.sprintf(String('%s.py, line %d'), new pyjslib.Tuple([s.module, s.lineno])));
			}
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return String('\x0A').join(stackstrings);
};
sys.trackstackstr.__name__ = 'trackstackstr';

sys.trackstackstr.__bind_type__ = 0;
sys.trackstackstr.__args__ = [null,null,'stack'];
sys.platform = $pyjs.platform;
sys.byteorder = String('little');
return this;
}; /* end sys */
$pyjs.modules_hash['sys'] = $pyjs.loaded_modules['sys'];


 /* end module: sys */



/* start module: index */
var index = $pyjs.loaded_modules["index"] = function (__mod_name__) {
if(index.__was_initialized__) return index;
index.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'index';
var __name__ = index.__name__ = __mod_name__;
pyjslib.__import__(['pyjd'], 'pyjd', 'index');
index.pyjd = $pyjs.__modules__.pyjd;
pyjslib.__import__(['pyjamas.Window', 'pyjamas'], 'pyjamas.Window', 'index');
index.Window = $pyjs.__modules__.pyjamas.Window;
pyjslib.__import__(['pyjamas.HTTPRequest.HTTPRequest', 'pyjamas.HTTPRequest'], 'pyjamas.HTTPRequest.HTTPRequest', 'index');
index.HTTPRequest = $pyjs.__modules__.pyjamas.HTTPRequest.HTTPRequest;
pyjslib.__import__(['pyjamas.JSONService.JSONProxy', 'pyjamas.JSONService'], 'pyjamas.JSONService.JSONProxy', 'index');
index.JSONProxy = $pyjs.__modules__.pyjamas.JSONService.JSONProxy;
pyjslib.__import__(['pyjamas.ui.decoratorpanel.DecoratedTabPanel', 'pyjamas.ui.decoratorpanel'], 'pyjamas.ui.decoratorpanel.DecoratedTabPanel', 'index');
index.DecoratedTabPanel = $pyjs.__modules__.pyjamas.ui.decoratorpanel.DecoratedTabPanel;
pyjslib.__import__(['pyjamas.ui.decoratorpanel.DecoratorPanel', 'pyjamas.ui.decoratorpanel'], 'pyjamas.ui.decoratorpanel.DecoratorPanel', 'index');
index.DecoratorPanel = $pyjs.__modules__.pyjamas.ui.decoratorpanel.DecoratorPanel;
pyjslib.__import__(['pyjamas.ui.decoratorpanel.DecoratorTitledPanel', 'pyjamas.ui.decoratorpanel'], 'pyjamas.ui.decoratorpanel.DecoratorTitledPanel', 'index');
index.DecoratorTitledPanel = $pyjs.__modules__.pyjamas.ui.decoratorpanel.DecoratorTitledPanel;
pyjslib.__import__(['pyjamas.ui.Button.Button', 'pyjamas.ui.Button'], 'pyjamas.ui.Button.Button', 'index');
index.Button = $pyjs.__modules__.pyjamas.ui.Button.Button;
pyjslib.__import__(['pyjamas.ui.Label.Label', 'pyjamas.ui.Label'], 'pyjamas.ui.Label.Label', 'index');
index.Label = $pyjs.__modules__.pyjamas.ui.Label.Label;
pyjslib.__import__(['pyjamas.ui.Grid.Grid', 'pyjamas.ui.Grid'], 'pyjamas.ui.Grid.Grid', 'index');
index.Grid = $pyjs.__modules__.pyjamas.ui.Grid.Grid;
pyjslib.__import__(['pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.CellFormatter'], 'pyjamas.ui.CellFormatter.CellFormatter', 'index');
index.CellFormatter = $pyjs.__modules__.pyjamas.ui.CellFormatter.CellFormatter;
pyjslib.__import__(['pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.RowFormatter'], 'pyjamas.ui.RowFormatter.RowFormatter', 'index');
index.RowFormatter = $pyjs.__modules__.pyjamas.ui.RowFormatter.RowFormatter;
pyjslib.__import__(['pyjamas.ui.HTMLTable.HTMLTable', 'pyjamas.ui.HTMLTable'], 'pyjamas.ui.HTMLTable.HTMLTable', 'index');
index.HTMLTable = $pyjs.__modules__.pyjamas.ui.HTMLTable.HTMLTable;
pyjslib.__import__(['pyjamas.ui.CheckBox.CheckBox', 'pyjamas.ui.CheckBox'], 'pyjamas.ui.CheckBox.CheckBox', 'index');
index.CheckBox = $pyjs.__modules__.pyjamas.ui.CheckBox.CheckBox;
pyjslib.__import__(['pyjamas.ui.AbsolutePanel.AbsolutePanel', 'pyjamas.ui.AbsolutePanel'], 'pyjamas.ui.AbsolutePanel.AbsolutePanel', 'index');
index.AbsolutePanel = $pyjs.__modules__.pyjamas.ui.AbsolutePanel.AbsolutePanel;
index.Button = $pyjs.__modules__.pyjamas.ui.Button.Button;
index.CheckBox = $pyjs.__modules__.pyjamas.ui.CheckBox.CheckBox;
pyjslib.__import__(['pyjamas.ui.VerticalPanel.VerticalPanel', 'pyjamas.ui.VerticalPanel'], 'pyjamas.ui.VerticalPanel.VerticalPanel', 'index');
index.VerticalPanel = $pyjs.__modules__.pyjamas.ui.VerticalPanel.VerticalPanel;
pyjslib.__import__(['pyjamas.ui.HorizontalPanel.HorizontalPanel', 'pyjamas.ui.HorizontalPanel'], 'pyjamas.ui.HorizontalPanel.HorizontalPanel', 'index');
index.HorizontalPanel = $pyjs.__modules__.pyjamas.ui.HorizontalPanel.HorizontalPanel;
pyjslib.__import__(['pyjamas.ui.RadioButton.RadioButton', 'pyjamas.ui.RadioButton'], 'pyjamas.ui.RadioButton.RadioButton', 'index');
index.RadioButton = $pyjs.__modules__.pyjamas.ui.RadioButton.RadioButton;
index.Button = $pyjs.__modules__.pyjamas.ui.Button.Button;
index.Label = $pyjs.__modules__.pyjamas.ui.Label.Label;
pyjslib.__import__(['pyjamas.ui.TabPanel.TabPanel', 'pyjamas.ui.TabPanel'], 'pyjamas.ui.TabPanel.TabPanel', 'index');
index.TabPanel = $pyjs.__modules__.pyjamas.ui.TabPanel.TabPanel;
pyjslib.__import__(['pyjamas.ui.HasAlignment', 'pyjamas.ui'], 'pyjamas.ui.HasAlignment', 'index');
index.HasAlignment = $pyjs.__modules__.pyjamas.ui.HasAlignment;
pyjslib.__import__(['pyjamas.ui.Image.Image', 'pyjamas.ui.Image'], 'pyjamas.ui.Image.Image', 'index');
index.Image = $pyjs.__modules__.pyjamas.ui.Image.Image;
index.VerticalPanel = $pyjs.__modules__.pyjamas.ui.VerticalPanel.VerticalPanel;
pyjslib.__import__(['pyjamas.ui.RootPanel.RootPanel', 'pyjamas.ui.RootPanel'], 'pyjamas.ui.RootPanel.RootPanel', 'index');
index.RootPanel = $pyjs.__modules__.pyjamas.ui.RootPanel.RootPanel;
index.HorizontalPanel = $pyjs.__modules__.pyjamas.ui.HorizontalPanel.HorizontalPanel;
pyjslib.__import__(['pyjamas.ui.HTML.HTML', 'pyjamas.ui.HTML'], 'pyjamas.ui.HTML.HTML', 'index');
index.HTML = $pyjs.__modules__.pyjamas.ui.HTML.HTML;
pyjslib.__import__(['pyjamas.ui.Composite.Composite', 'pyjamas.ui.Composite'], 'pyjamas.ui.Composite.Composite', 'index');
index.Composite = $pyjs.__modules__.pyjamas.ui.Composite.Composite;
pyjslib.__import__(['pyjamas.ui.MouseListener', 'pyjamas.ui'], 'pyjamas.ui.MouseListener', 'index');
index.MouseListener = $pyjs.__modules__.pyjamas.ui.MouseListener;
pyjslib.__import__(['pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'index');
index.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjslib.__import__(['pygwt'], 'pygwt', 'index');
index.pygwt = $pyjs.__modules__.pygwt;
pyjslib.__import__(['pyjamas.JSONParser', 'pyjamas'], 'pyjamas.JSONParser', 'index');
index.JSONParser = $pyjs.__modules__.pyjamas.JSONParser;
index.GridWidget = (function(){
	var cls_instance = pyjs__class_instance('GridWidget');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'cca600a2c86b007cf34bb14adca35a87';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(wtf, tab) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			wtf = arguments[1];
			tab = arguments[2];
		}

		index.AbsolutePanel.__init__(self);
		if (pyjslib.bool(pyjslib.eq(tab, String('Dashboard')))) {
			self.dashboard();
		}
		else if (pyjslib.bool(pyjslib.eq(tab, String('Invoices')))) {
			self.rock();
		}
		else if (pyjslib.bool(pyjslib.eq(tab, String('Clients')))) {
			self.rock();
		}
		else if (pyjslib.bool(pyjslib.eq(tab, String('Company')))) {
			self.company();
		}
		else if (pyjslib.bool(pyjslib.eq(tab, String('Users')))) {
			self.users();
		}
		else {
			index.Window.alert(tab);
		}
		return null;
	}
	, 1, [null,null,'self', 'wtf', 'tab']);
	cls_definition.users = pyjs__bind_method(cls_instance, 'users', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.g = index.Grid();
		self.g.resize(5, 5);
		self.g.setHTML(0, 0, String('\x3Cstrong\x3EUsername\x3C/strong\x3E'));
		self.g.setHTML(0, 1, String('\x3Cstrong\x3EPassword\x3C/strong\x3E'));
		self.g.setHTML(0, 2, String('\x3Cstrong\x3EOwner\x3C/strong\x3E'));
		self.g.setHTML(0, 3, String('\x3Cstrong\x3EEdit\x3C/strong\x3E'));
		self.g.setHTML(0, 4, String('\x3Cstrong\x3EDelete\x3C/strong\x3E'));
		self.g.setHTML(1, 0, String('andy@txm.net'));
		self.g.setHTML(1, 1, String('********'));
		self.g.setWidget(1, 2, index.RadioButton(String('admin_user')));
		self.g.setWidget(1, 3, index.RadioButton(String('edit_user')));
		self.g.setWidget(1, 4, index.CheckBox(String('delete_user1')));
		self.g.setHTML(2, 0, String('rock@txm.net'));
		self.g.setHTML(2, 1, String('********'));
		self.g.setWidget(2, 2, index.RadioButton(String('admin_user')));
		self.g.setWidget(2, 3, index.RadioButton(String('edit_user')));
		self.g.setWidget(2, 4, index.CheckBox(String('delete_user2')));
		self.g.setHTML(3, 0, String('finance@txm.net'));
		self.g.setHTML(3, 1, String('********'));
		self.g.setWidget(3, 2, index.RadioButton(String('admin_user')));
		self.g.setWidget(3, 3, index.RadioButton(String('edit_user')));
		self.g.setWidget(3, 4, index.CheckBox(String('delete_user3')));
		self.g.setHTML(4, 0, String('\x26nbsp\x3B'));
		self.g.setHTML(4, 1, String('\x26nbsp\x3B'));
		self.g.setWidget(4, 2, index.Button(String('Set Admin')));
		self.g.setWidget(4, 3, index.Button(String('Edit User')));
		self.g.setWidget(4, 4, index.Button(String('Delete User')));
		self.g.setBorderWidth(2);
		self.g.setCellPadding(4);
		self.g.setCellSpacing(1);
		self.add(self.g);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.company = pyjs__bind_method(cls_instance, 'company', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.g = index.Grid();
		self.g.resize(10, 2);
		self.g.setHTML(0, 0, String('\x3Cstrong\x3ECompany Name\x3C/strong\x3E'));
		self.g.setHTML(1, 0, String('\x3Cstrong\x3EPrimary User\x3C/strong\x3E'));
		self.g.setHTML(2, 0, String('\x3Cstrong\x3EAddress\x3C/strong\x3E'));
		self.g.setHTML(3, 0, String('\x3Cstrong\x3EPostcode\x3C/strong\x3E'));
		self.g.setHTML(4, 0, String('\x3Cstrong\x3ECountry\x3C/strong\x3E'));
		self.g.setHTML(5, 0, String('\x3Cstrong\x3ETelephone\x3C/strong\x3E'));
		self.g.setHTML(6, 0, String('\x3Cstrong\x3EFax\x3C/strong\x3E'));
		self.g.setHTML(7, 0, String('\x3Cstrong\x3ERegistered Company Number\x3C/strong\x3E'));
		self.g.setHTML(8, 0, String('\x3Cstrong\x3EVAT Number\x3C/strong\x3E'));
		self.g.setHTML(9, 0, String('\x3Cstrong\x3E\x26nbsp\x3B\x3C/strong\x3E'));
		self.g.setHTML(0, 1, String('TXM'));
		self.g.setHTML(1, 1, String('Andrew McGregor'));
		self.g.setHTML(2, 1, String('6 Pembroke Road, Clifton, Bristol'));
		self.g.setHTML(3, 1, String('BS8 3AX'));
		self.g.setHTML(4, 1, String('Country'));
		self.g.setHTML(5, 1, String('07940 22 33 11'));
		self.g.setHTML(6, 1, String('n/a'));
		self.g.setHTML(7, 1, String('123 456 78'));
		self.g.setHTML(8, 1, String('123 456 78'));
		self.g.setWidget(9, 1, index.Button(String('Edit')));
		self.g.setBorderWidth(2);
		self.g.setCellPadding(4);
		self.g.setCellSpacing(1);
		self.add(self.g);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.dashboard = pyjs__bind_method(cls_instance, 'dashboard', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.g = index.Grid();
		self.g.resize(5, 5);
		self.g.setHTML(0, 0, String('\x3Cb\x3EGrid Test\x3C/b\x3E'));
		self.g.setBorderWidth(2);
		self.g.setCellPadding(4);
		self.g.setCellSpacing(1);
		self.add(self.g);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.rock = pyjs__bind_method(cls_instance, 'rock', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.page = 0;
		self.min_page = 1;
		self.max_page = 10;
		self.addb = index.Button(String('Next \x3E'), self);
		self.subb = index.Button(String('\x3C Prev'), self);
		self.g = index.Grid();
		self.g.resize(5, 5);
		self.g.setHTML(0, 0, String('\x3Cb\x3EGrid Test\x3C/b\x3E'));
		self.g.setBorderWidth(2);
		self.g.setCellPadding(4);
		self.g.setCellSpacing(1);
		self.updatePageDisplay();
		self.add(self.subb);
		self.add(self.addb);
		self.add(self.g);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.onClick = pyjs__bind_method(cls_instance, 'onClick', function(sender) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			sender = arguments[1];
		}

		if (pyjslib.bool(pyjslib.eq(sender, self.addb))) {
			self.page += 1;
		}
		else if (pyjslib.bool(pyjslib.eq(sender, self.subb))) {
			self.page -= 1;
		}
		self.updatePageDisplay();
		return null;
	}
	, 1, [null,null,'self', 'sender']);
	cls_definition.updatePageDisplay = pyjs__bind_method(cls_instance, 'updatePageDisplay', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var y,x,total_pages;
		if (pyjslib.bool((pyjslib.cmp(self.page, self.min_page) == -1))) {
			self.page = self.min_page;
		}
		else if (pyjslib.bool((pyjslib.cmp(self.page, self.max_page) == 1))) {
			self.page = self.max_page;
		}
		total_pages =  (  ( self.max_page - self.min_page )  + 1 ) ;
		self.g.setHTML(0, 4, pyjslib.sprintf(String('\x3Cb\x3Epage %d of %d\x3C/b\x3E'), new pyjslib.Tuple([self.page, total_pages])));
		if (pyjslib.bool((pyjslib.cmp(self.page, self.max_page) != -1))) {
			self.addb.setEnabled(false);
		}
		else {
			self.addb.setEnabled(true);
		}
		if (pyjslib.bool((pyjslib.cmp(self.page, self.min_page) != 1))) {
			self.subb.setEnabled(false);
		}
		else {
			self.subb.setEnabled(true);
		}
		var __y = pyjslib.range(1, 5).__iter__();
		try {
			while (true) {
				var y = __y.next();
				
				var __x = pyjslib.range(5).__iter__();
				try {
					while (true) {
						var x = __x.next();
						
						self.g.setText(y, x, pyjslib.sprintf(String('%d (%d,%d)'), new pyjslib.Tuple([self.page, x, y])));
					}
				} catch (e) {
					if (e.__name__ != 'StopIteration') {
						throw e;
					}
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(index.AbsolutePanel));
})();
index.AJAXLoader = (function(){
	var cls_instance = pyjs__class_instance('AJAXLoader');
	var cls_definition = new Object();
	cls_definition.__md5__ = '619c2feafd3a05c6012f020d768b3255';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(panel) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			panel = arguments[1];
		}

		self.panel = panel;
		return null;
	}
	, 1, [null,null,'self', 'panel']);
	cls_definition.onCompletion = pyjs__bind_method(cls_instance, 'onCompletion', function(text) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
		}

		self.panel.setMessage(text);
		return null;
	}
	, 1, [null,null,'self', 'text']);
	cls_definition.onError = pyjs__bind_method(cls_instance, 'onError', function(text, code) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
			code = arguments[2];
		}

		self.panel.onError(text, code);
		return null;
	}
	, 1, [null,null,'self', 'text', 'code']);
	cls_definition.onTimeout = pyjs__bind_method(cls_instance, 'onTimeout', function(text) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
		}

		self.panel.onTimeout(text);
		return null;
	}
	, 1, [null,null,'self', 'text']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
index.InvoiceSite = (function(){
	var cls_instance = pyjs__class_instance('InvoiceSite');
	var cls_definition = new Object();
	cls_definition.__md5__ = '9ea591691f73d02bbfa0d62566d9258e';
	cls_definition.onModuleLoad = pyjs__bind_method(cls_instance, 'onModuleLoad', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var ok,dp;
		self.Tabs = pyjs_kwargs_call(index, 'DecoratedTabPanel', null, null, [{Size:new pyjslib.Tuple([String('800px'), String('100%')])}]);
		self.Tabs.add(index.GridWidget(self, String('Dashboard')), String('Dashboard'));
		self.Tabs.add(index.GridWidget(self, String('Invoices')), String('Invoices'));
		self.Tabs.add(index.GridWidget(self, String('Clients')), String('Clients'));
		self.Tabs.add(index.GridWidget(self, String('Company')), String('Company'));
		self.Tabs.add(index.GridWidget(self, String('Users')), String('Users'));
		self.Tabs.selectTab(4);
		dp = index.DecoratorTitledPanel(String('invoicesite.com'), String('bluetitle'), String('bluetitleicon'), new pyjslib.List([String('bluetop'), String('bluetop2'), String('bluemiddle'), String('bluebottom')]));
		dp.add(self.Tabs);
		index.RootPanel().add(dp);
		self.message = index.HTML();
		index.RootPanel().add(self.message);
		if (pyjslib.bool(index.HTTPRequest().asyncGet(null, null, String('/rpc?action=GetCompany'), index.AJAXLoader(self)))) {
			ok = true;
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.setMessage = pyjs__bind_method(cls_instance, 'setMessage', function(content) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			content = arguments[1];
		}
		var msg,r,msg_data;
		msg = new pyjslib.Dict([[String('id'), index.id], [String('method'), index.method], [String('params'), index.params]]);
		msg_data = index.dumps(msg);
		index.Window.alert(msg_data);
		r = index.loads(content);
		self.message.setHTML(pyjslib.sprintf(String('\x3Cpre\x3EAJAX: %s\x3C/pre\x3E'), r));
		return null;
	}
	, 1, [null,null,'self', 'content']);
	cls_definition.onError = pyjs__bind_method(cls_instance, 'onError', function(text, code) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
			code = arguments[2];
		}

		index.Window.alert( (  ( text + String('\x3Cbr /\x3E') )  + code ) );
		return null;
	}
	, 1, [null,null,'self', 'text', 'code']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
if (pyjslib.bool(pyjslib.eq(index.__name__, String('__main__')))) {
	index.pyjd.setup(String('./public/index.html'));
	index.app = index.InvoiceSite();
	index.app.onModuleLoad();
	index.pyjd.run();
}
return this;
}; /* end index */
$pyjs.modules_hash['index'] = $pyjs.loaded_modules['index'];


 /* end module: index */


/*
PYJS_DEPS: ['pyjd', 'pyjamas.Window', 'pyjamas', 'pyjamas.HTTPRequest.HTTPRequest', 'pyjamas.HTTPRequest', 'pyjamas.JSONService.JSONProxy', 'pyjamas.JSONService', 'pyjamas.ui.decoratorpanel.DecoratedTabPanel', 'pyjamas.ui', 'pyjamas.ui.decoratorpanel', 'pyjamas.ui.decoratorpanel.DecoratorPanel', 'pyjamas.ui.decoratorpanel.DecoratorTitledPanel', 'pyjamas.ui.Button.Button', 'pyjamas.ui.Button', 'pyjamas.ui.Label.Label', 'pyjamas.ui.Label', 'pyjamas.ui.Grid.Grid', 'pyjamas.ui.Grid', 'pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.CellFormatter', 'pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.RowFormatter', 'pyjamas.ui.HTMLTable.HTMLTable', 'pyjamas.ui.HTMLTable', 'pyjamas.ui.CheckBox.CheckBox', 'pyjamas.ui.CheckBox', 'pyjamas.ui.AbsolutePanel.AbsolutePanel', 'pyjamas.ui.AbsolutePanel', 'pyjamas.ui.VerticalPanel.VerticalPanel', 'pyjamas.ui.VerticalPanel', 'pyjamas.ui.HorizontalPanel.HorizontalPanel', 'pyjamas.ui.HorizontalPanel', 'pyjamas.ui.RadioButton.RadioButton', 'pyjamas.ui.RadioButton', 'pyjamas.ui.TabPanel.TabPanel', 'pyjamas.ui.TabPanel', 'pyjamas.ui.HasAlignment', 'pyjamas.ui.Image.Image', 'pyjamas.ui.Image', 'pyjamas.ui.RootPanel.RootPanel', 'pyjamas.ui.RootPanel', 'pyjamas.ui.HTML.HTML', 'pyjamas.ui.HTML', 'pyjamas.ui.Composite.Composite', 'pyjamas.ui.Composite', 'pyjamas.ui.MouseListener', 'pyjamas.ui.Event', 'pygwt', 'pyjamas.JSONParser']
*/

/* start module: pyjd */
var pyjd = $pyjs.loaded_modules["pyjd"] = function (__mod_name__) {
if(pyjd.__was_initialized__) return pyjd;
pyjd.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjd';
var __name__ = pyjd.__name__ = __mod_name__;
pyjd.setup = function(application, appdir, width, height) {
	if (typeof appdir == 'undefined') appdir=null;
	if (typeof width == 'undefined') width=800;
	if (typeof height == 'undefined') height=600;

 	return null;
};
pyjd.setup.__name__ = 'setup';

pyjd.setup.__bind_type__ = 0;
pyjd.setup.__args__ = [null,null,'application', 'appdir', 'width', 'height'];
pyjd.run = function() {

 	return null;
};
pyjd.run.__name__ = 'run';

pyjd.run.__bind_type__ = 0;
pyjd.run.__args__ = [null,null];
return this;
}; /* end pyjd */
$pyjs.modules_hash['pyjd'] = $pyjs.loaded_modules['pyjd'];


 /* end module: pyjd */



/* start module: pyjamas */
var pyjamas = $pyjs.loaded_modules["pyjamas"] = function (__mod_name__) {
if(pyjamas.__was_initialized__) return pyjamas;
pyjamas.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas';
var __name__ = pyjamas.__name__ = __mod_name__;
 return this;
}; /* end pyjamas */
$pyjs.modules_hash['pyjamas'] = $pyjs.loaded_modules['pyjamas'];


 /* end module: pyjamas */



/* start module: pyjamas.Window */
pyjamas.Window = $pyjs.loaded_modules["pyjamas.Window"] = function (__mod_name__) {
if(pyjamas.Window.__was_initialized__) return pyjamas.Window;
pyjamas.Window.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.Window';
var __name__ = pyjamas.Window.__name__ = __mod_name__;
var Window = pyjamas.Window;

pyjamas.Window.closingListeners = new pyjslib.List([]);
pyjamas.Window.resizeListeners = new pyjslib.List([]);
pyjslib.__import__(['pyjamas.pyjamas.Location', 'pyjamas.pyjamas', 'pyjamas.Location', 'pyjamas'], 'pyjamas.Location', 'pyjamas.Window');
pyjamas.Window.Location = $pyjs.__modules__.pyjamas.Location;
pyjamas.Window.init_listeners = function() {

	if (pyjslib.bool(!(pyjamas.Window.closingListeners))) {
		pyjamas.Window.closingListeners = new pyjslib.List([]);
	}
	if (pyjslib.bool(!(pyjamas.Window.resizeListeners))) {
		pyjamas.Window.resizeListeners = new pyjslib.List([]);
	}
	return null;
};
pyjamas.Window.init_listeners.__name__ = 'init_listeners';

pyjamas.Window.init_listeners.__bind_type__ = 0;
pyjamas.Window.init_listeners.__args__ = [null,null];
pyjamas.Window.addWindowCloseListener = function(listener) {

	pyjamas.Window.closingListeners.append(listener);
	return null;
};
pyjamas.Window.addWindowCloseListener.__name__ = 'addWindowCloseListener';

pyjamas.Window.addWindowCloseListener.__bind_type__ = 0;
pyjamas.Window.addWindowCloseListener.__args__ = [null,null,'listener'];
pyjamas.Window.addWindowResizeListener = function(listener) {

	pyjamas.Window.resizeListeners.append(listener);
	return null;
};
pyjamas.Window.addWindowResizeListener.__name__ = 'addWindowResizeListener';

pyjamas.Window.addWindowResizeListener.__bind_type__ = 0;
pyjamas.Window.addWindowResizeListener.__args__ = [null,null,'listener'];
pyjamas.Window.removeWindowCloseListener = function(listener) {

	pyjamas.Window.closingListeners.remove(listener);
	return null;
};
pyjamas.Window.removeWindowCloseListener.__name__ = 'removeWindowCloseListener';

pyjamas.Window.removeWindowCloseListener.__bind_type__ = 0;
pyjamas.Window.removeWindowCloseListener.__args__ = [null,null,'listener'];
pyjamas.Window.removeWindowResizeListener = function(listener) {

	pyjamas.Window.resizeListeners.remove(listener);
	return null;
};
pyjamas.Window.removeWindowResizeListener.__name__ = 'removeWindowResizeListener';

pyjamas.Window.removeWindowResizeListener.__bind_type__ = 0;
pyjamas.Window.removeWindowResizeListener.__args__ = [null,null,'listener'];
pyjamas.Window.alert = function(msg) {

	$wnd.alert(msg);
	return null;
};
pyjamas.Window.alert.__name__ = 'alert';

pyjamas.Window.alert.__bind_type__ = 0;
pyjamas.Window.alert.__args__ = [null,null,'msg'];
pyjamas.Window.confirm = function(msg) {

	return $wnd.confirm(msg);
};
pyjamas.Window.confirm.__name__ = 'confirm';

pyjamas.Window.confirm.__bind_type__ = 0;
pyjamas.Window.confirm.__args__ = [null,null,'msg'];
pyjamas.Window.prompt = function(msg, defaultReply) {
	if (typeof defaultReply == 'undefined') defaultReply=String('');

	return $wnd.prompt(msg, defaultReply);
};
pyjamas.Window.prompt.__name__ = 'prompt';

pyjamas.Window.prompt.__bind_type__ = 0;
pyjamas.Window.prompt.__args__ = [null,null,'msg', 'defaultReply'];
pyjamas.Window.enableScrolling = function(enable) {

	$doc.body.style.overflow = ((enable) && (String('auto'))) || (String('hidden'));
	return null;
};
pyjamas.Window.enableScrolling.__name__ = 'enableScrolling';

pyjamas.Window.enableScrolling.__bind_type__ = 0;
pyjamas.Window.enableScrolling.__args__ = [null,null,'enable'];
pyjamas.Window.scrollBy = function(x, y) {

	$wnd.scrollBy(x, y);
	return null;
};
pyjamas.Window.scrollBy.__name__ = 'scrollBy';

pyjamas.Window.scrollBy.__bind_type__ = 0;
pyjamas.Window.scrollBy.__args__ = [null,null,'x', 'y'];
pyjamas.Window.scroll = function(x, y) {

	$wnd.scroll(x, y);
	return null;
};
pyjamas.Window.scroll.__name__ = 'scroll';

pyjamas.Window.scroll.__bind_type__ = 0;
pyjamas.Window.scroll.__args__ = [null,null,'x', 'y'];
pyjamas.Window.getClientHeight = function() {

	return $wnd.innerHeight;
};
pyjamas.Window.getClientHeight.__name__ = 'getClientHeight';

pyjamas.Window.getClientHeight.__bind_type__ = 0;
pyjamas.Window.getClientHeight.__args__ = [null,null];
pyjamas.Window.getClientWidth = function() {

	return $wnd.innerWidth;
};
pyjamas.Window.getClientWidth.__name__ = 'getClientWidth';

pyjamas.Window.getClientWidth.__bind_type__ = 0;
pyjamas.Window.getClientWidth.__args__ = [null,null];
pyjamas.Window.setLocation = function(url) {
	var w;
	w = $wnd;
	w.location = url;
	return null;
};
pyjamas.Window.setLocation.__name__ = 'setLocation';

pyjamas.Window.setLocation.__bind_type__ = 0;
pyjamas.Window.setLocation.__args__ = [null,null,'url'];
pyjamas.Window.location = null;
pyjamas.Window.getLocation = function() {

	if (pyjslib.bool(!(pyjamas.Window.location))) {
		pyjamas.Window.location = pyjamas.Window.Location.Location($wnd.location);
	}
	return pyjamas.Window.location;
};
pyjamas.Window.getLocation.__name__ = 'getLocation';

pyjamas.Window.getLocation.__bind_type__ = 0;
pyjamas.Window.getLocation.__args__ = [null,null];
pyjamas.Window.getTitle = function() {

	return $doc.title;
};
pyjamas.Window.getTitle.__name__ = 'getTitle';

pyjamas.Window.getTitle.__bind_type__ = 0;
pyjamas.Window.getTitle.__args__ = [null,null];
pyjamas.Window.open = function(url, name, features) {

	pyjamas.Window.document.parent.open(url, name, features);
	return null;
};
pyjamas.Window.open.__name__ = 'open';

pyjamas.Window.open.__bind_type__ = 0;
pyjamas.Window.open.__args__ = [null,null,'url', 'name', 'features'];
pyjamas.Window.setMargin = function(size) {

	$doc.body.style.margin = size;
	return null;
};
pyjamas.Window.setMargin.__name__ = 'setMargin';

pyjamas.Window.setMargin.__bind_type__ = 0;
pyjamas.Window.setMargin.__args__ = [null,null,'size'];
pyjamas.Window.setTitle = function(title) {
	var d;
	d = $doc;
	d.title = title;
	return null;
};
pyjamas.Window.setTitle.__name__ = 'setTitle';

pyjamas.Window.setTitle.__bind_type__ = 0;
pyjamas.Window.setTitle.__args__ = [null,null,'title'];
pyjamas.Window.setOnError = function(onError) {

	if (pyjslib.bool(!(pyjslib.callable(onError)))) {
		throw (pyjslib.TypeError(String('object is not callable')));
	}
    $wnd.onerror=function(msg, url, linenumber){
        return onError(msg, url, linenumber);
    }
    
};
pyjamas.Window.setOnError.__name__ = 'setOnError';

pyjamas.Window.setOnError.__bind_type__ = 0;
pyjamas.Window.setOnError.__args__ = [null,null,'onError'];
pyjamas.Window.onError = function(msg, url, linenumber) {
	var tracestr,dialog;
	dialog = $doc.createElement(String('div'));
	dialog.className = String('errordialog');
	tracestr = pyjamas.Window.sys.trackstackstr($pyjs.trackstack.slice(0,-1));
	tracestr = tracestr.replace(String('\x0A'), String('\x3Cbr /\x3E\x0A\x26nbsp\x3B\x26nbsp\x3B\x26nbsp\x3B'));
	dialog.innerHTML =  (  (  (  (  (  ( String('\x26nbsp\x3B\x3Cb style=\x22color:red\x22\x3EJavaScript Error: \x3C/b\x3E') + msg )  + String(' at line number ') )  + linenumber )  + String('. Please inform webmaster.') )  + String('\x3Cbr /\x3E\x26nbsp\x3B\x26nbsp\x3B\x26nbsp\x3B') )  + tracestr ) ;
	$doc.body.appendChild(dialog);
	return true;
};
pyjamas.Window.onError.__name__ = 'onError';

pyjamas.Window.onError.__bind_type__ = 0;
pyjamas.Window.onError.__args__ = [null,null,'msg', 'url', 'linenumber'];
pyjamas.Window.onClosed = function() {

	pyjamas.Window.fireClosedImpl();
	return null;
};
pyjamas.Window.onClosed.__name__ = 'onClosed';

pyjamas.Window.onClosed.__bind_type__ = 0;
pyjamas.Window.onClosed.__args__ = [null,null];
pyjamas.Window.onClosing = function() {

	pyjamas.Window.fireClosingImpl();
	return null;
};
pyjamas.Window.onClosing.__name__ = 'onClosing';

pyjamas.Window.onClosing.__bind_type__ = 0;
pyjamas.Window.onClosing.__args__ = [null,null];
pyjamas.Window.onResize = function() {

	pyjamas.Window.fireResizedImpl();
	return null;
};
pyjamas.Window.onResize.__name__ = 'onResize';

pyjamas.Window.onResize.__bind_type__ = 0;
pyjamas.Window.onResize.__args__ = [null,null];
pyjamas.Window.fireClosedAndCatch = function(handler) {

 	return null;
};
pyjamas.Window.fireClosedAndCatch.__name__ = 'fireClosedAndCatch';

pyjamas.Window.fireClosedAndCatch.__bind_type__ = 0;
pyjamas.Window.fireClosedAndCatch.__args__ = [null,null,'handler'];
pyjamas.Window.fireClosedImpl = function() {
	var listener;
	var __listener = pyjamas.Window.closingListeners.__iter__();
	try {
		while (true) {
			var listener = __listener.next();
			
			listener.onWindowClosed();
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return null;
};
pyjamas.Window.fireClosedImpl.__name__ = 'fireClosedImpl';

pyjamas.Window.fireClosedImpl.__bind_type__ = 0;
pyjamas.Window.fireClosedImpl.__args__ = [null,null];
pyjamas.Window.fireClosingAndCatch = function(handler) {

 	return null;
};
pyjamas.Window.fireClosingAndCatch.__name__ = 'fireClosingAndCatch';

pyjamas.Window.fireClosingAndCatch.__bind_type__ = 0;
pyjamas.Window.fireClosingAndCatch.__args__ = [null,null,'handler'];
pyjamas.Window.resize = function(width, height) {

	$wnd.resizeTo(width, height);
	return null;
};
pyjamas.Window.resize.__name__ = 'resize';

pyjamas.Window.resize.__bind_type__ = 0;
pyjamas.Window.resize.__args__ = [null,null,'width', 'height'];
pyjamas.Window.resizeBy = function(width, height) {

	$wnd.resizeBy(width, height);
	return null;
};
pyjamas.Window.resizeBy.__name__ = 'resizeBy';

pyjamas.Window.resizeBy.__bind_type__ = 0;
pyjamas.Window.resizeBy.__args__ = [null,null,'width', 'height'];
pyjamas.Window.fireClosingImpl = function() {
	var listener,msg,ret;
	ret = null;
	var __listener = pyjamas.Window.closingListeners.__iter__();
	try {
		while (true) {
			var listener = __listener.next();
			
			msg = listener.onWindowClosing();
			if (pyjslib.bool((ret === null))) {
				ret = msg;
			}
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return ret;
};
pyjamas.Window.fireClosingImpl.__name__ = 'fireClosingImpl';

pyjamas.Window.fireClosingImpl.__bind_type__ = 0;
pyjamas.Window.fireClosingImpl.__args__ = [null,null];
pyjamas.Window.fireResizedAndCatch = function(handler) {

 	return null;
};
pyjamas.Window.fireResizedAndCatch.__name__ = 'fireResizedAndCatch';

pyjamas.Window.fireResizedAndCatch.__bind_type__ = 0;
pyjamas.Window.fireResizedAndCatch.__args__ = [null,null,'handler'];
pyjamas.Window.fireResizedImpl = function() {
	var listener;
	var __listener = pyjamas.Window.resizeListeners.__iter__();
	try {
		while (true) {
			var listener = __listener.next();
			
			listener.onWindowResized(pyjamas.Window.getClientWidth(), pyjamas.Window.getClientHeight());
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return null;
};
pyjamas.Window.fireResizedImpl.__name__ = 'fireResizedImpl';

pyjamas.Window.fireResizedImpl.__bind_type__ = 0;
pyjamas.Window.fireResizedImpl.__args__ = [null,null];
pyjamas.Window.init = function() {

	pyjslib.__import__(['pyjamas.sys', 'sys'], 'sys', 'pyjamas.Window');
	pyjamas.Window.sys = $pyjs.__modules__.sys;
	pyjamas.Window.init_listeners();

    $wnd.__pygwt_initHandlers(
        function() {
            Window.onResize();
        },
        function() {
            return Window.onClosing();
        },
        function() {
            Window.onClosed();
            /*$wnd.onresize = null;
            $wnd.onbeforeclose = null;
            $wnd.onclose = null;*/
        }
    );
    
	pyjamas.Window.setOnError(pyjamas.Window.onError);
	return null;
};
pyjamas.Window.init.__name__ = 'init';

pyjamas.Window.init.__bind_type__ = 0;
pyjamas.Window.init.__args__ = [null,null];
pyjamas.Window.init();
return this;
}; /* end pyjamas.Window */
$pyjs.modules_hash['pyjamas.Window'] = $pyjs.loaded_modules['pyjamas.Window'];


 /* end module: pyjamas.Window */


/*
PYJS_DEPS: ['pyjamas.Location', 'pyjamas', 'sys']
*/

/* start module: pyjamas.Location */
pyjamas.Location = $pyjs.loaded_modules["pyjamas.Location"] = function (__mod_name__) {
if(pyjamas.Location.__was_initialized__) return pyjamas.Location;
pyjamas.Location.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.Location';
var __name__ = pyjamas.Location.__name__ = __mod_name__;
var Location = pyjamas.Location;

pyjamas.Location.makeUrlDict = function(s) {
	var pair,dict,pairs,kv;
	dict = new pyjslib.Dict([]);
	pairs = s.split(String('\x26'));
	var __pair = pairs.__iter__();
	try {
		while (true) {
			var pair = __pair.next();
			
			if (pyjslib.bool((pyjslib.cmp(pyjslib.len(pair), 3) == -1))) {
				continue;
			}
			kv = pair.split(String('='), 1);
			dict.__setitem__(kv.__getitem__(0), kv.__getitem__(1));
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return dict;
};
pyjamas.Location.makeUrlDict.__name__ = 'makeUrlDict';

pyjamas.Location.makeUrlDict.__bind_type__ = 0;
pyjamas.Location.makeUrlDict.__args__ = [null,null,'s'];
pyjamas.Location.makeUrlStringFromDict = function(d) {
	var k,pairs,temp_k,v;
	pairs = new pyjslib.List([]);
	var __temp_k = d.iteritems().__iter__();
	try {
		while (true) {
			var temp_k = __temp_k.next();
				var k = temp_k.__getitem__(0);	var v = temp_k.__getitem__(1);
			pairs.append( (  ( k + String('=') )  + v ) );
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return String('\x26').join(pairs);
};
pyjamas.Location.makeUrlStringFromDict.__name__ = 'makeUrlStringFromDict';

pyjamas.Location.makeUrlStringFromDict.__bind_type__ = 0;
pyjamas.Location.makeUrlStringFromDict.__args__ = [null,null,'d'];
pyjamas.Location.Location = (function(){
	var cls_instance = pyjs__class_instance('Location');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'a4fcff30ca40a643570eae7172c36034';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(location) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			location = arguments[1];
		}

		self.location = location;
		self.searchDict = null;
		return null;
	}
	, 1, [null,null,'self', 'location']);
	cls_definition.getHash = pyjs__bind_method(cls_instance, 'getHash', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.location.hash;
	}
	, 1, [null,null,'self']);
	cls_definition.getHashDict = pyjs__bind_method(cls_instance, 'getHashDict', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool((!(self.hashDict)) || (!pyjslib.eq(self.hashDictHash, self.getHash())))) {
			self.hashDictHash = self.getHash();
			self.hashDict = pyjamas.Location.makeUrlDict(pyjslib.slice(self.getHash(), 1, null));
		}
		return self.hashDict;
	}
	, 1, [null,null,'self']);
	cls_definition.getHost = pyjs__bind_method(cls_instance, 'getHost', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.location.host;
	}
	, 1, [null,null,'self']);
	cls_definition.getHostname = pyjs__bind_method(cls_instance, 'getHostname', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.location.hostname;
	}
	, 1, [null,null,'self']);
	cls_definition.getHref = pyjs__bind_method(cls_instance, 'getHref', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.location.href;
	}
	, 1, [null,null,'self']);
	cls_definition.getPageHref = pyjs__bind_method(cls_instance, 'getPageHref', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var href;
		href = self.location.href;
		if (pyjslib.bool(href.find(String('?')))) {
			href = href.split(String('?')).__getitem__(0);
		}
		if (pyjslib.bool(href.find(String('#')))) {
			href = href.split(String('#')).__getitem__(0);
		}
		return href;
	}
	, 1, [null,null,'self']);
	cls_definition.getPathname = pyjs__bind_method(cls_instance, 'getPathname', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.location.pathname;
	}
	, 1, [null,null,'self']);
	cls_definition.getPort = pyjs__bind_method(cls_instance, 'getPort', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.location.port;
	}
	, 1, [null,null,'self']);
	cls_definition.getProtocol = pyjs__bind_method(cls_instance, 'getProtocol', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.location.protocol;
	}
	, 1, [null,null,'self']);
	cls_definition.getSearch = pyjs__bind_method(cls_instance, 'getSearch', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return  ( String('') + self.location.search ) ;
	}
	, 1, [null,null,'self']);
	cls_definition.getSearchDict = pyjs__bind_method(cls_instance, 'getSearchDict', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool(pyjslib.isinstance(self.location, pyjslib.str))) {
			return new pyjslib.Dict([]);
		}
		if (pyjslib.bool(!(self.searchDict))) {
			self.searchDict = pyjamas.Location.makeUrlDict(pyjslib.slice(self.getSearch(), 1, null));
		}
		return self.searchDict;
	}
	, 1, [null,null,'self']);
	cls_definition.getSearchVar = pyjs__bind_method(cls_instance, 'getSearchVar', function(key) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
		}
		var searchDict;
		searchDict = self.getSearchDict();
		return searchDict.get(key);
	}
	, 1, [null,null,'self', 'key']);
	cls_definition.reload = pyjs__bind_method(cls_instance, 'reload', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.location.reload();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.setHref = pyjs__bind_method(cls_instance, 'setHref', function(href) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			href = arguments[1];
		}

		self.location.href = href;
		return null;
	}
	, 1, [null,null,'self', 'href']);
	cls_definition.setSearch = pyjs__bind_method(cls_instance, 'setSearch', function(search) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			search = arguments[1];
		}

		self.location.search = search;
		return null;
	}
	, 1, [null,null,'self', 'search']);
	cls_definition.setSearchDict = pyjs__bind_method(cls_instance, 'setSearchDict', function(searchDict) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			searchDict = arguments[1];
		}

		self.setSearch(pyjamas.Location.makeUrlStringFromDict(searchDict));
		return null;
	}
	, 1, [null,null,'self', 'searchDict']);
	cls_definition.setHash = pyjs__bind_method(cls_instance, 'setHash', function(hash) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			hash = arguments[1];
		}

		self.location.hash = hash;
		return null;
	}
	, 1, [null,null,'self', 'hash']);
	cls_definition.setHashDict = pyjs__bind_method(cls_instance, 'setHashDict', function(hashDict) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			hashDict = arguments[1];
		}

		self.setHash(pyjamas.Location.makeUrlStringFromDict(hashDict));
		return null;
	}
	, 1, [null,null,'self', 'hashDict']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
return this;
}; /* end pyjamas.Location */
$pyjs.modules_hash['pyjamas.Location'] = $pyjs.loaded_modules['pyjamas.Location'];


 /* end module: pyjamas.Location */



/* start module: pyjamas.HTTPRequest */
pyjamas.HTTPRequest = $pyjs.loaded_modules["pyjamas.HTTPRequest"] = function (__mod_name__) {
if(pyjamas.HTTPRequest.__was_initialized__) return pyjamas.HTTPRequest;
pyjamas.HTTPRequest.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.HTTPRequest';
var __name__ = pyjamas.HTTPRequest.__name__ = __mod_name__;
var HTTPRequest = pyjamas.HTTPRequest;

pyjslib.__import__(['pyjamas.sys', 'sys'], 'sys', 'pyjamas.HTTPRequest');
pyjamas.HTTPRequest.sys = $pyjs.__modules__.sys;
pyjslib.__import__(['pyjamas.pygwt', 'pygwt'], 'pygwt', 'pyjamas.HTTPRequest');
pyjamas.HTTPRequest.pygwt = $pyjs.__modules__.pygwt;
if (pyjslib.bool(!new pyjslib.List([String('mozilla'), String('ie6'), String('opera'), String('oldmoz'), String('safari')]).__contains__(pyjamas.HTTPRequest.sys.platform))) {
}
pyjamas.HTTPRequest.handlers = new pyjslib.Dict([]);
pyjamas.HTTPRequest.HTTPRequest = (function(){
	var cls_instance = pyjs__class_instance('HTTPRequest');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'a0f823a32f317a4c33659c998d14323b';
	cls_definition.asyncPost = pyjs__bind_method(cls_instance, 'asyncPost', function(user, pwd, url, postData, handler, returnxml, content_type) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			user = arguments[1];
			pwd = arguments[2];
			url = arguments[3];
			postData = arguments[4];
			handler = arguments[5];
			returnxml = arguments[6];
			content_type = arguments[7];
		}
		if (typeof postData == 'undefined') postData=null;
		if (typeof handler == 'undefined') handler=null;
		if (typeof returnxml == 'undefined') returnxml=0;
		if (typeof content_type == 'undefined') content_type=String('text/plain charset=utf8');

		if (pyjslib.bool((postData === null))) {
			return self.asyncPostImpl(null, null, user, pwd, url, returnxml, content_type);
		}
		return self.asyncPostImpl(user, pwd, url, postData, handler, returnxml, content_type);
	}
	, 1, [null,null,'self', 'user', 'pwd', 'url', 'postData', 'handler', 'returnxml', 'content_type']);
	cls_definition.asyncGet = pyjs__bind_method(cls_instance, 'asyncGet', function(user, pwd, url, handler, returnxml) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			user = arguments[1];
			pwd = arguments[2];
			url = arguments[3];
			handler = arguments[4];
			returnxml = arguments[5];
		}
		if (typeof returnxml == 'undefined') returnxml=0;

		if (pyjslib.bool((url === null))) {
			return self.asyncGetImpl(null, null, user, pwd, returnxml);
		}
		return self.asyncGetImpl(user, pwd, url, handler, returnxml);
	}
	, 1, [null,null,'self', 'user', 'pwd', 'url', 'handler', 'returnxml']);
	cls_definition.createXmlHTTPRequest = pyjs__bind_method(cls_instance, 'createXmlHTTPRequest', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.doCreateXmlHTTPRequest();
	}
	, 1, [null,null,'self']);
	cls_definition.doCreateXmlHTTPRequest = pyjs__bind_method(cls_instance, 'doCreateXmlHTTPRequest', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}


        return new XMLHttpRequest();
        
	}
	, 1, [null,null,'self']);
	cls_definition.onLoad = pyjs__bind_method(cls_instance, 'onLoad', function(sender, event, ignorearg) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			sender = arguments[1];
			event = arguments[2];
			ignorearg = arguments[3];
		}
		var status,localHandler,xmlHttp,handler,responseText;
		xmlHttp = event.target;
		localHandler = pyjamas.HTTPRequest.handlers.get(xmlHttp);
    pyjamas.HTTPRequest.handlers.__delitem__(xmlHttp);
		responseText = xmlHttp.responseText;
		status = xmlHttp.status;
		handler = null;
		xmlHttp = null;
		if (pyjslib.bool(pyjslib.eq(status, 0))) {
		}
		if (pyjslib.bool((pyjslib.eq(status, 200)) || (pyjslib.eq(status, 0)))) {
			localHandler.onCompletion(responseText);
		}
		else {
			localHandler.onError(responseText, status);
		}
		return null;
	}
	, 1, [null,null,'self', 'sender', 'event', 'ignorearg']);
	cls_definition.onReadyStateChange = pyjs__bind_method(cls_instance, 'onReadyStateChange', function(xmlHttp, event, ignorearg) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			xmlHttp = arguments[1];
			event = arguments[2];
			ignorearg = arguments[3];
		}
		var status,localHandler,err,handler,pyjs_try_err,responseText;
		try {
			xmlHttp = pyjamas.HTTPRequest.get_main_frame().gobject_wrap(xmlHttp);
		} catch(pyjs_try_err) {
			var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
			$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjamas.HTTPRequest, try_lineno: 51};
			{
				$pyjs.__last_exception__.except_lineno = 54;
				err = pyjs_try_err;
			} 		}
		if (pyjslib.bool(!pyjslib.eq(xmlHttp.readyState, 4))) {
			return null;
		}
		localHandler = pyjamas.HTTPRequest.handlers.get(xmlHttp);
    pyjamas.HTTPRequest.handlers.__delitem__(xmlHttp);
		responseText = xmlHttp.responseText;
		status = xmlHttp.status;
		handler = null;
		xmlHttp = null;
		if (pyjslib.bool(pyjslib.eq(status, 0))) {
		}
		if (pyjslib.bool((pyjslib.eq(status, 200)) || (pyjslib.eq(status, 0)))) {
			localHandler.onCompletion(responseText);
		}
		else {
			localHandler.onError(responseText, status);
		}
		return null;
	}
	, 1, [null,null,'self', 'xmlHttp', 'event', 'ignorearg']);
	cls_definition._convertUrlToAbsolute = pyjs__bind_method(cls_instance, '_convertUrlToAbsolute', function(url) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			url = arguments[1];
		}
		var uri,slash,sep;
		uri = pyjamas.HTTPRequest.pygwt.getModuleBaseURL();
		if (pyjslib.bool(pyjslib.eq(url.__getitem__(0), String('/')))) {
			sep = uri.find(String('://'));
			if (pyjslib.bool(!(uri.startswith(String('file://'))))) {
				slash = uri.find(String('/'),  ( sep + 3 ) );
				if (pyjslib.bool((pyjslib.cmp(slash, 0) == 1))) {
					uri = pyjslib.slice(uri, null, slash);
				}
			}
			return pyjslib.sprintf(String('%s%s'), new pyjslib.Tuple([uri, url]));
		}
		else {
			if (pyjslib.bool((!pyjslib.eq(pyjslib.slice(url, null, 7), String('file://'))) && (!pyjslib.eq(pyjslib.slice(url, null, 7), String('http://'))) && (!pyjslib.eq(pyjslib.slice(url, null, 8), String('https://'))))) {
				slash = uri.rfind(String('/'));
				return  ( pyjslib.slice(uri, null,  ( slash + 1 ) ) + url ) ;
			}
		}
		return url;
	}
	, 1, [null,null,'self', 'url']);
	cls_definition.asyncPostImpl = pyjs__bind_method(cls_instance, 'asyncPostImpl', function(user, pwd, url, postData, handler, returnxml, content_type) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			user = arguments[1];
			pwd = arguments[2];
			url = arguments[3];
			postData = arguments[4];
			handler = arguments[5];
			returnxml = arguments[6];
			content_type = arguments[7];
		}
		var pdlen;
		pdlen = pyjslib.str(pyjslib.len(postData));

        var xmlHttp = this.doCreateXmlHTTPRequest();
        try {
            xmlHttp.open("POST", url, true);
            xmlHttp.setRequestHeader("Content-Type", content_type);
            xmlHttp.setRequestHeader("Content-Length", pdlen);
            xmlHttp.onreadystatechange = function() {
                if (xmlHttp.readyState == 4) {
                    delete xmlHttp.onreadystatechange;
                    var localHandler = handler;
                    var response;
                    var status = xmlHttp.status;
                    if (returnxml)
                        response = xmlHttp.responseXML;
                    else
                        response = xmlHttp.responseText;
                    handler = null;
                    xmlHttp = null;
                    if(status == 200) {
                        localHandler.onCompletion(response);
                    } else {
                        localHandler.onError(response, status);
                    }
                }
            };
            xmlHttp.send(postData);
            return true;
        }
        catch (e) {
            delete xmlHttp.onreadystatechange;
            var localHandler = handler;
            handler = null;
            xmlHttp = null;
            localHandler.onError(String(e), "");
            return false;
        }
        
	}
	, 1, [null,null,'self', 'user', 'pwd', 'url', 'postData', 'handler', 'returnxml', 'content_type']);
	cls_definition.asyncGetImpl = pyjs__bind_method(cls_instance, 'asyncGetImpl', function(user, pwd, url, handler, returnxml) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			user = arguments[1];
			pwd = arguments[2];
			url = arguments[3];
			handler = arguments[4];
			returnxml = arguments[5];
		}
		if (typeof returnxml == 'undefined') returnxml=0;


        var xmlHttp = this.doCreateXmlHTTPRequest();
        try {
            xmlHttp.open("GET", url, true);
            if (returnxml)
                xmlHttp.setRequestHeader("Content-Type", "application/xml; charset=utf-8");
            else
                xmlHttp.setRequestHeader("Content-Type", "text/plain; charset=utf-8");
            xmlHttp.onreadystatechange = function() {
                if (xmlHttp.readyState == 4) {
                    delete xmlHttp.onreadystatechange;
                    var localHandler = handler;
                    var response;
                    var status = xmlHttp.status;
                    if (returnxml)
                        response = xmlHttp.responseXML;
                    else
                        response = xmlHttp.responseText;
                    handler = null;
                    xmlHttp = null;
                    if(status == 200) {
                        localHandler.onCompletion(response);
                    } else {
                        localHandler.onError(response, status);
                    }
                }
            };
            xmlHttp.send('');
            return true;
        }
        catch (e) {
            delete xmlHttp.onreadystatechange;
            var localHandler = handler;
            handler = null;
            xmlHttp = null;
            localHandler.onError(String(e), "");
            return false;
        }
        
	}
	, 1, [null,null,'self', 'user', 'pwd', 'url', 'handler', 'returnxml']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
return this;
}; /* end pyjamas.HTTPRequest */
$pyjs.modules_hash['pyjamas.HTTPRequest'] = $pyjs.loaded_modules['pyjamas.HTTPRequest'];


 /* end module: pyjamas.HTTPRequest */


/*
PYJS_DEPS: ['sys', 'pygwt']
*/

/* start module: pygwt */
var pygwt = $pyjs.loaded_modules["pygwt"] = function (__mod_name__) {
if(pygwt.__was_initialized__) return pygwt;
pygwt.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pygwt';
var __name__ = pygwt.__name__ = __mod_name__;
pygwt.sNextHashId = 0;
pygwt.getNextHashId = function() {

	pygwt.sNextHashId += 1;
	return pygwt.sNextHashId;
};
pygwt.getNextHashId.__name__ = 'getNextHashId';

pygwt.getNextHashId.__bind_type__ = 0;
pygwt.getNextHashId.__args__ = [null,null];
pygwt.getHashCode = function(o) {


    return (o == null) ? 0 :
        (o.$H ? o.$H : (o.$H = pygwt_getNextHashId()));
    
};
pygwt.getHashCode.__name__ = 'getHashCode';

pygwt.getHashCode.__bind_type__ = 0;
pygwt.getHashCode.__args__ = [null,null,'o'];
pygwt.getModuleName = function() {


    return $moduleName;
    
};
pygwt.getModuleName.__name__ = 'getModuleName';

pygwt.getModuleName.__bind_type__ = 0;
pygwt.getModuleName.__args__ = [null,null];
pygwt.getModuleBaseURL = function() {


    // this is intentionally not using $doc, because we want the module's own url
    var s = document.location.href;
    
    // Pull off any hash.
    var i = s.indexOf('#');
    if (i != -1)
        s = s.substring(0, i);
    
    // Pull off any query string.
    i = s.indexOf('?');
    if (i != -1)
        s = s.substring(0, i);
    
    // Rip off everything after the last slash.
    i = s.lastIndexOf('/');
    if (i != -1)
        s = s.substring(0, i);

    return (s.length > 0) ? s + "/" : "";
    
};
pygwt.getModuleBaseURL.__name__ = 'getModuleBaseURL';

pygwt.getModuleBaseURL.__bind_type__ = 0;
pygwt.getModuleBaseURL.__args__ = [null,null];
return this;
}; /* end pygwt */
$pyjs.modules_hash['pygwt'] = $pyjs.loaded_modules['pygwt'];


 /* end module: pygwt */



/* start module: pyjamas.JSONService */
pyjamas.JSONService = $pyjs.loaded_modules["pyjamas.JSONService"] = function (__mod_name__) {
if(pyjamas.JSONService.__was_initialized__) return pyjamas.JSONService;
pyjamas.JSONService.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.JSONService';
var __name__ = pyjamas.JSONService.__name__ = __mod_name__;
var JSONService = pyjamas.JSONService;

pyjslib.__import__(['pyjamas.sys', 'sys'], 'sys', 'pyjamas.JSONService');
pyjamas.JSONService.sys = $pyjs.__modules__.sys;
pyjslib.__import__(['pyjamas.pyjamas.HTTPRequest.HTTPRequest', 'pyjamas.pyjamas.HTTPRequest', 'pyjamas.HTTPRequest.HTTPRequest', 'pyjamas.HTTPRequest'], 'pyjamas.HTTPRequest.HTTPRequest', 'pyjamas.JSONService');
pyjamas.JSONService.HTTPRequest = $pyjs.__modules__.pyjamas.HTTPRequest.HTTPRequest;
pyjslib.__import__(['pyjamas.pygwt', 'pygwt'], 'pygwt', 'pyjamas.JSONService');
pyjamas.JSONService.pygwt = $pyjs.__modules__.pygwt;
pyjamas.JSONService.JSONService = (function(){
	var cls_instance = pyjs__class_instance('JSONService');
	var cls_definition = new Object();
	cls_definition.__md5__ = '87d637b389dbecc2afc711d0f8fd08cd';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(url, handler) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			url = arguments[1];
			handler = arguments[2];
		}
		if (typeof handler == 'undefined') handler=null;
		var JSONParser;
		pyjslib.__import__(['pyjamas.pyjamas.JSONParser.JSONParser', 'pyjamas.pyjamas.JSONParser', 'pyjamas.JSONParser.JSONParser', 'pyjamas.JSONParser'], 'pyjamas.JSONParser.JSONParser', 'pyjamas.JSONService');
		JSONParser = $pyjs.__modules__.pyjamas.JSONParser.JSONParser;
		self.parser = JSONParser();
		self.url = url;
		self.handler = handler;
		return null;
	}
	, 1, [null,null,'self', 'url', 'handler']);
	cls_definition.callMethod = pyjs__bind_method(cls_instance, 'callMethod', function(method, params, handler) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			method = arguments[1];
			params = arguments[2];
			handler = arguments[3];
		}
		if (typeof handler == 'undefined') handler=null;

		if (pyjslib.bool((handler === null))) {
			handler = self.handler;
		}
		if (pyjslib.bool((handler === null))) {
			return self.__sendNotify(method, params);
		}
		else {
			return self.__sendRequest(method, params, handler);
		}
		return null;
	}
	, 1, [null,null,'self', 'method', 'params', 'handler']);
	cls_definition.onCompletion = pyjs__bind_method(cls_instance, 'onCompletion', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

 		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.sendNotify = pyjs__bind_method(cls_instance, 'sendNotify', function(method, params) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			method = arguments[1];
			params = arguments[2];
		}
		var dumps,msg_data,msg;
		pyjslib.__import__(['pyjamas.jsonrpc.json.dumps', 'pyjamas.jsonrpc.json', 'jsonrpc.json.dumps', 'jsonrpc.json'], 'jsonrpc.json.dumps', 'pyjamas.JSONService');
		dumps = $pyjs.__modules__.jsonrpc.json.dumps;
		msg = new pyjslib.Dict([[String('id'), null], [String('method'), method], [String('params'), params]]);
		msg_data = dumps(msg);
		if (pyjslib.bool(!(pyjs_kwargs_call(pyjamas.JSONService.HTTPRequest(), 'asyncPost', null, null, [{content_type:String('text/x-json')}, self.url, msg_data, self])))) {
			return -1;
		}
		return 1;
	}
	, 1, [null,null,'self', 'method', 'params']);
	cls_definition.sendRequest = pyjs__bind_method(cls_instance, 'sendRequest', function(method, params, handler) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			method = arguments[1];
			params = arguments[2];
			handler = arguments[3];
		}
		var dumps,id,msg_data,msg,request_info;
		pyjslib.__import__(['pyjamas.jsonrpc.json.dumps', 'pyjamas.jsonrpc.json', 'jsonrpc.json.dumps', 'jsonrpc.json'], 'jsonrpc.json.dumps', 'pyjamas.JSONService');
		dumps = $pyjs.__modules__.jsonrpc.json.dumps;
		id = pyjamas.JSONService.pygwt.getNextHashId();
		msg = new pyjslib.Dict([[String('id'), id], [String('method'), method], [String('params'), params]]);
		msg_data = dumps(msg);
		request_info = pyjamas.JSONService.JSONRequestInfo(id, method, handler);
		if (pyjslib.bool(!(pyjs_kwargs_call(pyjamas.JSONService.HTTPRequest(), 'asyncPost', null, null, [{content_type:String('text/x-json')}, self.url, msg_data, pyjamas.JSONService.JSONResponseTextHandler(request_info)])))) {
			return -1;
		}
		return id;
	}
	, 1, [null,null,'self', 'method', 'params', 'handler']);
	cls_definition.__sendNotify = pyjs__bind_method(cls_instance, '__sendNotify', function(method, params) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			method = arguments[1];
			params = arguments[2];
		}
		var msg,msg_data;
		msg = new pyjslib.Dict([[String('id'), null], [String('method'), method], [String('params'), params]]);
		msg_data = self.parser.encode(msg);
		if (pyjslib.bool(!(pyjamas.JSONService.HTTPRequest().asyncPost(self.url, msg_data, self)))) {
			return -1;
		}
		return 1;
	}
	, 1, [null,null,'self', 'method', 'params']);
	cls_definition.__sendRequest = pyjs__bind_method(cls_instance, '__sendRequest', function(method, params, handler) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			method = arguments[1];
			params = arguments[2];
			handler = arguments[3];
		}
		var id,msg_data,msg,request_info;
		id = pyjamas.JSONService.pygwt.getNextHashId();
		msg = new pyjslib.Dict([[String('id'), id], [String('method'), method], [String('params'), params]]);
		msg_data = self.parser.encode(msg);
		request_info = pyjamas.JSONService.JSONRequestInfo(id, method, handler);
		if (pyjslib.bool(!(pyjamas.JSONService.HTTPRequest().asyncPost(self.url, msg_data, pyjamas.JSONService.JSONResponseTextHandler(request_info))))) {
			return -1;
		}
		return id;
	}
	, 1, [null,null,'self', 'method', 'params', 'handler']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjamas.JSONService.JSONRequestInfo = (function(){
	var cls_instance = pyjs__class_instance('JSONRequestInfo');
	var cls_definition = new Object();
	cls_definition.__md5__ = '92a699fa1c4eac189af358aeb28e2f09';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(id, method, handler) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			id = arguments[1];
			method = arguments[2];
			handler = arguments[3];
		}

		self.id = id;
		self.method = method;
		self.handler = handler;
		return null;
	}
	, 1, [null,null,'self', 'id', 'method', 'handler']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjamas.JSONService.JSONResponseTextHandler = (function(){
	var cls_instance = pyjs__class_instance('JSONResponseTextHandler');
	var cls_definition = new Object();
	cls_definition.__md5__ = '677cf17e9dcf86a6a15a98152ebda25f';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(request) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			request = arguments[1];
		}

		self.request = request;
		return null;
	}
	, 1, [null,null,'self', 'request']);
	cls_definition.onCompletion = pyjs__bind_method(cls_instance, 'onCompletion', function(json_str) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			json_str = arguments[1];
		}
		var JSONParser,error,response;
		pyjslib.__import__(['pyjamas.pyjamas.JSONParser.JSONParser', 'pyjamas.pyjamas.JSONParser', 'pyjamas.JSONParser.JSONParser', 'pyjamas.JSONParser'], 'pyjamas.JSONParser.JSONParser', 'pyjamas.JSONService');
		JSONParser = $pyjs.__modules__.pyjamas.JSONParser.JSONParser;
		response = JSONParser().decodeAsObject(json_str);
		if (pyjslib.bool(!(response))) {
			self.request.handler.onRemoteError(0, String('Server Error or Invalid Response'), self.request);
		}
		else if (pyjslib.bool((response.has_key(String('error'))) && (response.__getitem__(String('error'))))) {
			error = response.__getitem__(String('error'));
			self.request.handler.onRemoteError(0, error, self.request);
		}
		else {
			self.request.handler.onRemoteResponse(response.__getitem__(String('result')), self.request);
		}
		return null;
	}
	, 1, [null,null,'self', 'json_str']);
	cls_definition.onError = pyjs__bind_method(cls_instance, 'onError', function(error_str, error_code) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			error_str = arguments[1];
			error_code = arguments[2];
		}

		self.request.handler.onRemoteError(error_code, error_str, self.request);
		return null;
	}
	, 1, [null,null,'self', 'error_str', 'error_code']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjamas.JSONService.ServiceProxy = (function(){
	var cls_instance = pyjs__class_instance('ServiceProxy');
	var cls_definition = new Object();
	cls_definition.__md5__ = '4067ccae1177a3b6757d3ad509d57bc0';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(serviceURL, serviceName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			serviceURL = arguments[1];
			serviceName = arguments[2];
		}
		if (typeof serviceName == 'undefined') serviceName=null;

		pyjamas.JSONService.JSONService.__init__(self, serviceURL);
		self.__serviceName = serviceName;
		return null;
	}
	, 1, [null,null,'self', 'serviceURL', 'serviceName']);
	cls_definition.__call__ = pyjs__bind_method(cls_instance, '__call__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var params = new Array();
			for (var pyjs__va_arg = 0; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
				var pyjs__arg = arguments[pyjs__va_arg];
				params.push(pyjs__arg);
			}
			params = pyjslib.Tuple(params);

		} else {
			var self = arguments[0];
			var params = new Array();
			for (var pyjs__va_arg = 1; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
				var pyjs__arg = arguments[pyjs__va_arg];
				params.push(pyjs__arg);
			}
			params = pyjslib.Tuple(params);

		}
		var handler;
		if (pyjslib.bool(pyjslib.hasattr(params.__getitem__(-1), String('onRemoteResponse')))) {
			handler = params.__getitem__(-1);
			return pyjamas.JSONService.JSONService.sendRequest(self, self.__serviceName, pyjslib.slice(params, null, -1), handler);
		}
		else {
			return pyjamas.JSONService.JSONService.sendNotify(self, self.__serviceName, params);
		}
		return null;
	}
	, 1, ['params',null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.JSONService.JSONService));
})();
pyjamas.JSONService.JSONProxy = (function(){
	var cls_instance = pyjs__class_instance('JSONProxy');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'e4516a27f9aea18a698f7c2d86dbfa44';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(url, methods) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			url = arguments[1];
			methods = arguments[2];
		}
		if (typeof methods == 'undefined') methods=null;

		pyjamas.JSONService.JSONService.__init__(self, url);
		if (pyjslib.bool(methods)) {
			self.__registerMethods(methods);
		}
		return null;
	}
	, 1, [null,null,'self', 'url', 'methods']);
	cls_definition.__createMethod = pyjs__bind_method(cls_instance, '__createMethod', function(method) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			method = arguments[1];
		}


        return function() {
            var params = [];
            for (var n=0; n<arguments.length; n++) { params.push(arguments[n]); }
            if (params[params.length-1].onRemoteResponse) {
                var handler=params.pop();
                return this.__sendRequest(method, params, handler);
            }
            else {
                return this.__sendNotify(method, params);
            }
        };
        
	}
	, 1, [null,null,'self', 'method']);
	cls_definition.__registerMethods = pyjs__bind_method(cls_instance, '__registerMethods', function(methods) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			methods = arguments[1];
		}


        methods=methods.l;
        for (var i in methods) {
            var method = methods[i];
            this[method]=this.__createMethod(method);
        }
        
	}
	, 1, [null,null,'self', 'methods']);
	cls_definition.__getattr__ = pyjs__bind_method(cls_instance, '__getattr__', function(name) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			name = arguments[1];
		}

		return pyjamas.JSONService.ServiceProxy(self._serviceURL, name);
	}
	, 1, [null,null,'self', 'name']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.JSONService.JSONService));
})();
return this;
}; /* end pyjamas.JSONService */
$pyjs.modules_hash['pyjamas.JSONService'] = $pyjs.loaded_modules['pyjamas.JSONService'];


 /* end module: pyjamas.JSONService */


/*
PYJS_DEPS: ['sys', 'pyjamas.HTTPRequest.HTTPRequest', 'pyjamas', 'pyjamas.HTTPRequest', 'pygwt', 'pyjamas.JSONParser.JSONParser', 'pyjamas.JSONParser', 'jsonrpc.json.dumps', 'jsonrpc', 'jsonrpc.json']
*/

/* start module: pyjamas.JSONParser */
pyjamas.JSONParser = $pyjs.loaded_modules["pyjamas.JSONParser"] = function (__mod_name__) {
if(pyjamas.JSONParser.__was_initialized__) return pyjamas.JSONParser;
pyjamas.JSONParser.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.JSONParser';
var __name__ = pyjamas.JSONParser.__name__ = __mod_name__;
var JSONParser = pyjamas.JSONParser;

pyjslib.__import__(['pyjamas.math', 'math'], 'math', 'pyjamas.JSONParser');
pyjamas.JSONParser.math = $pyjs.__modules__.math;
pyjamas.JSONParser.JSONParser = (function(){
	var cls_instance = pyjs__class_instance('JSONParser');
	var cls_definition = new Object();
	cls_definition.__md5__ = '47c6b9c5ac131702d03f5a6ea21bf8a6';
	cls_definition.decode = pyjs__bind_method(cls_instance, 'decode', function(str) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			str = arguments[1];
		}

		return self.jsObjectToPy(self.parseJSON(str));
	}
	, 1, [null,null,'self', 'str']);
	cls_definition.decodeAsObject = pyjs__bind_method(cls_instance, 'decodeAsObject', function(str) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			str = arguments[1];
		}

		return self.jsObjectToPyObject(self.parseJSON(str));
	}
	, 1, [null,null,'self', 'str']);
	cls_definition.encode = pyjs__bind_method(cls_instance, 'encode', function(obj) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			obj = arguments[1];
		}

		return self.toJSONString(obj);
	}
	, 1, [null,null,'self', 'obj']);
	cls_definition.jsObjectToPy = pyjs__bind_method(cls_instance, 'jsObjectToPy', function(obj) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			obj = arguments[1];
		}


        if (pyjslib.isArray(obj)) {
            for (var i in obj) obj[i] = this.jsObjectToPy(obj[i]);
            obj=new pyjslib.List(obj);
            }
        else if (pyjslib.isObject(obj)) {
            for (var i in obj) obj[i]=this.jsObjectToPy(obj[i]);
            obj=new pyjslib.Dict(obj);
            }
        
        return obj;
        
	}
	, 1, [null,null,'self', 'obj']);
	cls_definition.jsObjectToPyObject = pyjs__bind_method(cls_instance, 'jsObjectToPyObject', function(obj) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			obj = arguments[1];
		}


        if (pyjslib.isArray(obj)) {
            for (var i in obj) obj[i] = this.jsObjectToPyObject(obj[i]);
            obj=new pyjslib.List(obj);
            }
        else if (pyjslib.isObject(obj)) {
            if (obj["__jsonclass__"]) {
                var class_name = obj["__jsonclass__"][0];
                //class_name = class_name.replace(".", "_");
                
                var new_obj = eval("new " + class_name + "()");
                delete obj["__jsonclass__"];
                for (var i in obj) new_obj[i] = this.jsObjectToPyObject(obj[i]);
                obj = new_obj;
                }
            else {
                for (var i in obj) obj[i]=this.jsObjectToPyObject(obj[i]);
                obj=new pyjslib.Dict(obj);
                }       
            }
        
        return obj;
        
	}
	, 1, [null,null,'self', 'obj']);
	cls_definition.toJSONString = pyjs__bind_method(cls_instance, 'toJSONString', function(obj) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			obj = arguments[1];
		}


   var m = {
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        },
        s = {
            array: function (x) {
                var a = ['['], b, f, i, l = x.length, v;
                for (i = 0; i < l; i += 1) {
                    v = x[i];
                    f = s[typeof v];
                    if (f) {
                        v = f(v);
                        if (typeof v == 'string') {
                            if (b) {
                                a[a.length] = ',';
                            }
                            a[a.length] = v;
                            b = true;
                        }
                    }
                }
                a[a.length] = ']';
                return a.join('');
            },
            'boolean': function (x) {
                return String(x);
            },
            'undefined':function (x) {
               return "null";
            },
            'null': function (x) {
                return "null";
            },
            number: function (x) {
                return isFinite(x) ? String(x) : 'null';
            },
            object: function (x) {
                if (x) {
                    if (x instanceof Array) {
                        return s.array(x);
                    }
                    if (x instanceof pyjslib.List) {
                        return s.array(x.l);
                    }
                    if (x instanceof pyjslib.Dict) {
                        return s.object(pyjslib.toJSObjects(x));
                    }
                    var a = ['{'], b, f, i, v;
                    for (i in x) {
                        v = x[i];
                        f = s[typeof v];
                        if (f) {
                            v = f(v);
                            if (typeof v == 'string') {
                                if (b) {
                                    a[a.length] = ',';
                                }
                                a.push(s.string(i), ':', v);
                                b = true;
                            }
                        }
                    }
                    a[a.length] = '}';
                    return a.join('');
                }
                return 'null';
            },
            string: function (x) {
                if (/["\\\x00-\x1f]/.test(x)) {
                    x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
                        var c = m[b];
                        if (c) {
                            return c;
                        }
                        c = b.charCodeAt();
                        return '\\u00' +
                            math.floor(c / 16).toString(16) +
                            (c % 16).toString(16);
                    });
                }
                return '"' + x + '"';
            }
        };

        typ = typeof obj;
        f=s[typ];
        return f(obj);
        
	}
	, 1, [null,null,'self', 'obj']);
	cls_definition.parseJSON = pyjs__bind_method(cls_instance, 'parseJSON', function(str) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			str = arguments[1];
		}


        try {
            return (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(str)) &&
                eval('(' + str + ')');
        } catch (e) {
            return false;
        }
        
	}
	, 1, [null,null,'self', 'str']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
return this;
}; /* end pyjamas.JSONParser */
$pyjs.modules_hash['pyjamas.JSONParser'] = $pyjs.loaded_modules['pyjamas.JSONParser'];


 /* end module: pyjamas.JSONParser */


/*
PYJS_DEPS: ['math']
*/

/* start module: math */
var math = $pyjs.loaded_modules["math"] = function (__mod_name__) {
if(math.__was_initialized__) return math;
math.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'math';
var __name__ = math.__name__ = __mod_name__;

math.ceil = Math.ceil;
math.fabs = Math.abs;
math.floor = Math.floor;
math.exp = Math.exp;
math.log = Math.log;
math.pow = Math.pow;
math.sqrt = Math.sqrt;
math.cos = Math.cos;
math.sin = Math.sin;
math.tan = Math.tan;
math.acos = Math.acos;
math.asin = Math.asin;
math.atan = Math.atan;
math.atan2 = Math.atan2;
math.pi = Math.PI;
math.e = Math.E;

math.ldexp = function(x, i) {

	return  ( x * Math.pow(2,i) ) ;
};
math.ldexp.__name__ = 'ldexp';

math.ldexp.__bind_type__ = 0;
math.ldexp.__args__ = [null,null,'x', 'i'];
math.__log2__ = math.log(2);
math.frexp = function(x) {
	var e,m;
	if (pyjslib.bool(pyjslib.eq(x, 0))) {
		return new pyjslib.Tuple([0.0, 0]);
	}
	e =  ( pyjslib.int_( ( math.log(pyjslib.abs(x)) / math.__log2__ ) ) + 1 ) ;
	m =  ( x / Math.pow(2.0,e) ) ;
	return new pyjslib.Tuple([m, e]);
};
math.frexp.__name__ = 'frexp';

math.frexp.__bind_type__ = 0;
math.frexp.__args__ = [null,null,'x'];
return this;
}; /* end math */
$pyjs.modules_hash['math'] = $pyjs.loaded_modules['math'];


 /* end module: math */



/* start module: jsonrpc */
var jsonrpc = $pyjs.loaded_modules["jsonrpc"] = function (__mod_name__) {
if(jsonrpc.__was_initialized__) return jsonrpc;
jsonrpc.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'jsonrpc';
var __name__ = jsonrpc.__name__ = __mod_name__;
 return this;
}; /* end jsonrpc */
$pyjs.modules_hash['jsonrpc'] = $pyjs.loaded_modules['jsonrpc'];


 /* end module: jsonrpc */



/* start module: jsonrpc.json */
jsonrpc.json = $pyjs.loaded_modules["jsonrpc.json"] = function (__mod_name__) {
if(jsonrpc.json.__was_initialized__) return jsonrpc.json;
jsonrpc.json.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'jsonrpc.json';
var __name__ = jsonrpc.json.__name__ = __mod_name__;
var json = jsonrpc.json;

return this;
}; /* end jsonrpc.json */
$pyjs.modules_hash['jsonrpc.json'] = $pyjs.loaded_modules['jsonrpc.json'];


 /* end module: jsonrpc.json */



/* start module: pyjamas.ui */
pyjamas.ui = $pyjs.loaded_modules["pyjamas.ui"] = function (__mod_name__) {
if(pyjamas.ui.__was_initialized__) return pyjamas.ui;
pyjamas.ui.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui';
var __name__ = pyjamas.ui.__name__ = __mod_name__;
var ui = pyjamas.ui;

pyjamas.ui.HasHorizontalAlignment = (function(){
	var cls_instance = pyjs__class_instance('HasHorizontalAlignment');
	var cls_definition = new Object();
	cls_definition.__md5__ = '14e69138ac76e029b4b92da08d4f01b0';
	cls_definition.ALIGN_LEFT = String('left');
	cls_definition.ALIGN_CENTER = String('center');
	cls_definition.ALIGN_RIGHT = String('right');
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjamas.ui.HasVerticalAlignment = (function(){
	var cls_instance = pyjs__class_instance('HasVerticalAlignment');
	var cls_definition = new Object();
	cls_definition.__md5__ = '54d724413769681d085281c2ea24a91f';
	cls_definition.ALIGN_TOP = String('top');
	cls_definition.ALIGN_MIDDLE = String('middle');
	cls_definition.ALIGN_BOTTOM = String('bottom');
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjamas.ui.HasAlignment = (function(){
	var cls_instance = pyjs__class_instance('HasAlignment');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'b8484321fff8a8c6c84216125d152f6d';
	cls_definition.ALIGN_BOTTOM = String('bottom');
	cls_definition.ALIGN_MIDDLE = String('middle');
	cls_definition.ALIGN_TOP = String('top');
	cls_definition.ALIGN_CENTER = String('center');
	cls_definition.ALIGN_LEFT = String('left');
	cls_definition.ALIGN_RIGHT = String('right');
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjamas.ui.Applier = (function(){
	var cls_instance = pyjs__class_instance('Applier');
	var cls_definition = new Object();
	cls_definition.__md5__ = '944d57d375ba75dd86b2068c5d61ee86';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}
		var args,prop,fn;
		if (pyjslib.bool(kwargs)) {
			var __prop = kwargs.keys().__iter__();
			try {
				while (true) {
					var prop = __prop.next();
					
					fn = pyjslib.getattr(self, pyjslib.sprintf(String('set%s'), prop), null);
					if (pyjslib.bool(fn)) {
						args = kwargs.__getitem__(prop);
						if (pyjslib.bool(pyjslib.isinstance(args, pyjslib.tuple))) {
							pyjs_kwargs_call(null, fn, args, null, [{}]);
						}
						else {
							fn(args);
						}
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		return null;
	}
	, 1, [null,'kwargs','self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
return this;
}; /* end pyjamas.ui */
$pyjs.modules_hash['pyjamas.ui'] = $pyjs.loaded_modules['pyjamas.ui'];


 /* end module: pyjamas.ui */



/* start module: pyjamas.ui.decoratorpanel */
pyjamas.ui.decoratorpanel = $pyjs.loaded_modules["pyjamas.ui.decoratorpanel"] = function (__mod_name__) {
if(pyjamas.ui.decoratorpanel.__was_initialized__) return pyjamas.ui.decoratorpanel;
pyjamas.ui.decoratorpanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.decoratorpanel';
var __name__ = pyjamas.ui.decoratorpanel.__name__ = __mod_name__;
var decoratorpanel = pyjamas.ui.decoratorpanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.decoratorpanel');
pyjamas.ui.decoratorpanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui.pyjamas.ui.SimplePanel', 'pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui.SimplePanel'], 'pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui.decoratorpanel');
pyjamas.ui.decoratorpanel.SimplePanel = $pyjs.__modules__.pyjamas.ui.SimplePanel.SimplePanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.TabPanel.TabPanel', 'pyjamas.ui.pyjamas.ui.TabPanel', 'pyjamas.ui.TabPanel.TabPanel', 'pyjamas.ui.TabPanel'], 'pyjamas.ui.TabPanel.TabPanel', 'pyjamas.ui.decoratorpanel');
pyjamas.ui.decoratorpanel.TabPanel = $pyjs.__modules__.pyjamas.ui.TabPanel.TabPanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.TabBar.TabBar', 'pyjamas.ui.pyjamas.ui.TabBar', 'pyjamas.ui.TabBar.TabBar', 'pyjamas.ui.TabBar'], 'pyjamas.ui.TabBar.TabBar', 'pyjamas.ui.decoratorpanel');
pyjamas.ui.decoratorpanel.TabBar = $pyjs.__modules__.pyjamas.ui.TabBar.TabBar;
pyjamas.ui.decoratorpanel.DecoratorPanel = (function(){
	var cls_instance = pyjs__class_instance('DecoratorPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'c9c934ebfa211f1b107bab0fa5046717';
	cls_definition.DEFAULT_STYLENAME = String('gwt-DecoratorPanel');
	cls_definition.DEFAULT_ROW_STYLENAMES = new pyjslib.List([String('top'), String('middle'), String('bottom')]);
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(rowStyles, containerIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			rowStyles = arguments[1];
			containerIndex = arguments[2];
			var kwargs = arguments.length >= 4 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof containerIndex != 'undefined') {
				if (pyjslib.get_pyjs_classtype(containerIndex) == 'Dict') {
					kwargs = containerIndex;
					containerIndex = arguments[3];
				}
			} else 			if (typeof rowStyles != 'undefined') {
				if (pyjslib.get_pyjs_classtype(rowStyles) == 'Dict') {
					kwargs = rowStyles;
					rowStyles = arguments[3];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[3];
				}
			} else {
			}
		}
		if (typeof rowStyles == 'undefined') rowStyles=null;
		if (typeof containerIndex == 'undefined') containerIndex=1;
		var i,row;
		if (pyjslib.bool((rowStyles === null))) {
			rowStyles = self.DEFAULT_ROW_STYLENAMES;
		}
		self.table = pyjamas.ui.decoratorpanel.DOM.createTable();
		self.tbody = pyjamas.ui.decoratorpanel.DOM.createTBody();
		pyjamas.ui.decoratorpanel.DOM.appendChild(self.table, self.tbody);
		pyjamas.ui.decoratorpanel.DOM.setAttribute(self.table, String('cellSpacing'), String('0'));
		pyjamas.ui.decoratorpanel.DOM.setAttribute(self.table, String('cellPadding'), String('0'));
		var __i = pyjslib.range(pyjslib.len(rowStyles)).__iter__();
		try {
			while (true) {
				var i = __i.next();
				
				row = self.createTR(rowStyles.__getitem__(i));
				pyjamas.ui.decoratorpanel.DOM.appendChild(self.tbody, row);
				if (pyjslib.bool(pyjslib.eq(i, containerIndex))) {
					self.containerElem = pyjamas.ui.decoratorpanel.DOM.getFirstChild(pyjamas.ui.decoratorpanel.DOM.getChild(row, 1));
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), self.DEFAULT_STYLENAME);
		}
		pyjs_kwargs_call(pyjamas.ui.decoratorpanel.SimplePanel, '__init__', null, kwargs, [{}, self, self.table]);
		return null;
	}
	, 1, [null,'kwargs','self', 'rowStyles', 'containerIndex']);
	cls_definition.createTR = pyjs__bind_method(cls_instance, 'createTR', function(styleName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			styleName = arguments[1];
		}
		var trElem;
		trElem = pyjamas.ui.decoratorpanel.DOM.createTR();
		self.setStyleName(trElem, styleName);
		pyjamas.ui.decoratorpanel.DOM.appendChild(trElem, self.createTD( ( styleName + String('Left') ) ));
		pyjamas.ui.decoratorpanel.DOM.appendChild(trElem, self.createTD( ( styleName + String('Center') ) ));
		pyjamas.ui.decoratorpanel.DOM.appendChild(trElem, self.createTD( ( styleName + String('Right') ) ));
		return trElem;
	}
	, 1, [null,null,'self', 'styleName']);
	cls_definition.createTD = pyjs__bind_method(cls_instance, 'createTD', function(styleName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			styleName = arguments[1];
		}
		var inner,tdElem;
		tdElem = pyjamas.ui.decoratorpanel.DOM.createTD();
		inner = pyjamas.ui.decoratorpanel.DOM.createDiv();
		pyjamas.ui.decoratorpanel.DOM.appendChild(tdElem, inner);
		self.setStyleName(tdElem, styleName);
		self.setStyleName(inner,  ( styleName + String('Inner') ) );
		return tdElem;
	}
	, 1, [null,null,'self', 'styleName']);
	cls_definition.getCellElement = pyjs__bind_method(cls_instance, 'getCellElement', function(row, cell) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			cell = arguments[2];
		}
		var tr,td;
		tr = pyjamas.ui.decoratorpanel.DOM.getChild(self.tbody, row);
		td = pyjamas.ui.decoratorpanel.DOM.getChild(tr, cell);
		return pyjamas.ui.decoratorpanel.DOM.getFirstChild(td);
	}
	, 1, [null,null,'self', 'row', 'cell']);
	cls_definition.getContainerElement = pyjs__bind_method(cls_instance, 'getContainerElement', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.containerElem;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.decoratorpanel.SimplePanel));
})();
pyjamas.ui.decoratorpanel.DecoratedTabBar = (function(){
	var cls_instance = pyjs__class_instance('DecoratedTabBar');
	var cls_definition = new Object();
	cls_definition.__md5__ = '532478c04c08b707d8fad1fa86c0fec3';
	cls_definition.TAB_ROW_STYLES = new pyjslib.List([String('tabTop'), String('tabMiddle')]);
	cls_definition.STYLENAME_DEFAULT = String('gwt-DecoratedTabBar');
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		pyjs_kwargs_call(pyjamas.ui.decoratorpanel.TabBar, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.createTabTextWrapper = pyjs__bind_method(cls_instance, 'createTabTextWrapper', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.decoratorpanel.DecoratorPanel(self.TAB_ROW_STYLES, 1);
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.decoratorpanel.TabBar));
})();
pyjamas.ui.decoratorpanel.DecoratedTabPanel = (function(){
	var cls_instance = pyjs__class_instance('DecoratedTabPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'fb84702848a03539cbbeac638bb2a2fa';
	cls_definition.DEFAULT_STYLENAME = String('gwt-DecoratedTabPanel');
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), self.DEFAULT_STYLENAME);
		}
		pyjs_kwargs_call(pyjamas.ui.decoratorpanel.TabPanel, '__init__', null, kwargs, [{}, self, pyjamas.ui.decoratorpanel.DecoratedTabBar()]);
		self.getTabBar().setStyleName(pyjamas.ui.decoratorpanel.DecoratedTabBar.STYLENAME_DEFAULT);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.createTabTextWrapper = pyjs__bind_method(cls_instance, 'createTabTextWrapper', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.decoratorpanel.DecoratorPanel(pyjamas.ui.decoratorpanel.DecoratedTabBar.TAB_ROW_STYLES, 1);
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.decoratorpanel.TabPanel));
})();
pyjamas.ui.decoratorpanel.DecoratorTitledPanel = (function(){
	var cls_instance = pyjs__class_instance('DecoratorTitledPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'da18745f8318320ea74ab963cd124f3c';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(title, titleStyle, imgStyle, rowStyles, containerIndex, titleIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			title = arguments[1];
			titleStyle = arguments[2];
			imgStyle = arguments[3];
			rowStyles = arguments[4];
			containerIndex = arguments[5];
			titleIndex = arguments[6];
		}
		if (typeof titleStyle == 'undefined') titleStyle=null;
		if (typeof imgStyle == 'undefined') imgStyle=null;
		if (typeof rowStyles == 'undefined') rowStyles=null;
		if (typeof containerIndex == 'undefined') containerIndex=2;
		if (typeof titleIndex == 'undefined') titleIndex=1;
		var img,tdiv,inner;
		if (pyjslib.bool((rowStyles === null))) {
			rowStyles = new pyjslib.List([String('top'), String('top2'), String('middle'), String('bottom')]);
		}
		if (pyjslib.bool((titleStyle === null))) {
			titleStyle = String('title');
		}
		pyjamas.ui.decoratorpanel.DecoratorPanel.__init__(self, rowStyles, containerIndex);
		inner = self.getCellElement(titleIndex, 1);
		if (pyjslib.bool(imgStyle)) {
			img = pyjamas.ui.decoratorpanel.DOM.createDiv();
			pyjamas.ui.decoratorpanel.DOM.setAttribute(img, String('className'), imgStyle);
			pyjamas.ui.decoratorpanel.DOM.appendChild(inner, img);
		}
		tdiv = pyjamas.ui.decoratorpanel.DOM.createDiv();
		pyjamas.ui.decoratorpanel.DOM.setAttribute(tdiv, String('className'), titleStyle);
		pyjamas.ui.decoratorpanel.DOM.setInnerText(tdiv, title);
		pyjamas.ui.decoratorpanel.DOM.appendChild(inner, tdiv);
		return null;
	}
	, 1, [null,null,'self', 'title', 'titleStyle', 'imgStyle', 'rowStyles', 'containerIndex', 'titleIndex']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.decoratorpanel.DecoratorPanel));
})();
return this;
}; /* end pyjamas.ui.decoratorpanel */
$pyjs.modules_hash['pyjamas.ui.decoratorpanel'] = $pyjs.loaded_modules['pyjamas.ui.decoratorpanel'];


 /* end module: pyjamas.ui.decoratorpanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui', 'pyjamas.ui.SimplePanel', 'pyjamas.ui.TabPanel.TabPanel', 'pyjamas.ui.TabPanel', 'pyjamas.ui.TabBar.TabBar', 'pyjamas.ui.TabBar']
*/

/* start module: pyjamas.DOM */
pyjamas.DOM = $pyjs.loaded_modules["pyjamas.DOM"] = function (__mod_name__) {
if(pyjamas.DOM.__was_initialized__) return pyjamas.DOM;
pyjamas.DOM.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.DOM';
var __name__ = pyjamas.DOM.__name__ = __mod_name__;
var DOM = pyjamas.DOM;

pyjslib.__import__(['pyjamas.sys', 'sys'], 'sys', 'pyjamas.DOM');
pyjamas.DOM.sys = $pyjs.__modules__.sys;
if (pyjslib.bool(!new pyjslib.List([String('mozilla'), String('ie6'), String('opera'), String('oldmoz'), String('safari')]).__contains__(pyjamas.DOM.sys.platform))) {
	pyjslib.__import__(['pyjamas.pyjamas.Window.onResize', 'pyjamas.pyjamas.Window', 'pyjamas.Window.onResize', 'pyjamas.Window'], 'pyjamas.Window.onResize', 'pyjamas.DOM');
	pyjamas.DOM.onResize = $pyjs.__modules__.pyjamas.Window.onResize;
	pyjslib.__import__(['pyjamas.pyjamas.Window.onClosing', 'pyjamas.pyjamas.Window', 'pyjamas.Window.onClosing', 'pyjamas.Window'], 'pyjamas.Window.onClosing', 'pyjamas.DOM');
	pyjamas.DOM.onClosing = $pyjs.__modules__.pyjamas.Window.onClosing;
	pyjslib.__import__(['pyjamas.pyjamas.Window.onClosed', 'pyjamas.pyjamas.Window', 'pyjamas.Window.onClosed', 'pyjamas.Window'], 'pyjamas.Window.onClosed', 'pyjamas.DOM');
	pyjamas.DOM.onClosed = $pyjs.__modules__.pyjamas.Window.onClosed;
	pyjamas.DOM.currentEvent = null;
}
pyjamas.DOM.sCaptureElem = null;
pyjamas.DOM.sEventPreviewStack = new pyjslib.List([]);
pyjamas.DOM.listeners = new pyjslib.Dict([]);
pyjamas.DOM.get_listener = function(item) {
	var ret;
	if (pyjslib.bool((item === null))) {
		return null;
	}
	if (pyjslib.bool(pyjslib.hasattr(item, String('__instance__')))) {
		ret = pyjamas.DOM.listeners.get(item.__instance__);
	}
	else {
		ret = pyjamas.DOM.listeners.get(pyjslib.hash(item));
	}
	return ret;
};
pyjamas.DOM.get_listener.__name__ = 'get_listener';

pyjamas.DOM.get_listener.__bind_type__ = 0;
pyjamas.DOM.get_listener.__args__ = [null,null,'item'];
pyjamas.DOM.set_listener = function(item, listener) {

	if (pyjslib.bool(pyjslib.hasattr(item, String('__instance__')))) {
		pyjamas.DOM.listeners.__setitem__(item.__instance__, listener);
	}
	else {
		pyjamas.DOM.listeners.__setitem__(pyjslib.hash(item), listener);
	}
	return null;
};
pyjamas.DOM.set_listener.__name__ = 'set_listener';

pyjamas.DOM.set_listener.__bind_type__ = 0;
pyjamas.DOM.set_listener.__args__ = [null,null,'item', 'listener'];
pyjamas.DOM.init = function() {


    // Set up capture event dispatchers.
    $wnd.__dispatchCapturedMouseEvent = function(evt) {
        if ($wnd.__dispatchCapturedEvent(evt)) {
            var cap = DOM.getCaptureElement();
            if (cap && cap.__listener) {
                DOM.dispatchEvent(evt, cap, cap.__listener);
                evt.stopPropagation();
            }
        }
    };

    $wnd.__dispatchCapturedEvent = function(evt) {
        if (!DOM.previewEvent(evt)) {
            evt.stopPropagation();
            evt.preventDefault();
            return false;
        }

        return true;
        };

    $wnd.addEventListener(
        'mouseout',
        function(evt){
            var cap = DOM.getCaptureElement();
            if (cap) {
                if (!evt.relatedTarget) {
                    // When the mouse leaves the window during capture, release capture
                    // and synthesize an 'onlosecapture' event.
                    DOM.sCaptureElem = null;
                    if (cap.__listener) {
                        var lcEvent = $doc.createEvent('UIEvent');
                        lcEvent.initUIEvent('losecapture', false, false, $wnd, 0);
                        DOM.dispatchEvent(lcEvent, cap, cap.__listener);
                    }
                }
            }
        },
        true
    );


    $wnd.addEventListener('click', $wnd.__dispatchCapturedMouseEvent, true);
    $wnd.addEventListener('dblclick', $wnd.__dispatchCapturedMouseEvent, true);
    $wnd.addEventListener('mousedown', $wnd.__dispatchCapturedMouseEvent, true);
    $wnd.addEventListener('mouseup', $wnd.__dispatchCapturedMouseEvent, true);
    $wnd.addEventListener('mousemove', $wnd.__dispatchCapturedMouseEvent, true);
    $wnd.addEventListener('keydown', $wnd.__dispatchCapturedEvent, true);
    $wnd.addEventListener('keyup', $wnd.__dispatchCapturedEvent, true);
    $wnd.addEventListener('keypress', $wnd.__dispatchCapturedEvent, true);
    
    $wnd.__dispatchEvent = function(evt) {
    
        var listener, curElem = this;
        
        while (curElem && !(listener = curElem.__listener)) {
            curElem = curElem.parentNode;
        }
        if (curElem && curElem.nodeType != 1) {
            curElem = null;
        }
    
        if (listener) {
            DOM.dispatchEvent(evt, curElem, listener);
        }
    };
    
};
pyjamas.DOM.init.__name__ = 'init';

pyjamas.DOM.init.__bind_type__ = 0;
pyjamas.DOM.init.__args__ = [null,null];
pyjamas.DOM._dispatchWindowEvent = function(sender, evt, useCap) {

 	return null;
};
pyjamas.DOM._dispatchWindowEvent.__name__ = '_dispatchWindowEvent';

pyjamas.DOM._dispatchWindowEvent.__bind_type__ = 0;
pyjamas.DOM._dispatchWindowEvent.__args__ = [null,null,'sender', 'evt', 'useCap'];
pyjamas.DOM._dispatchEvent = function(sender, evt, useCap) {
	var curElem,err,cap,listener,pyjs_try_err;
	if (pyjslib.bool((evt === null))) {
		evt = $wnd.event;
	}
	else {
		try {
			sender = pyjamas.DOM.get_main_frame().gobject_wrap(sender);
			evt = pyjamas.DOM.get_main_frame().gobject_wrap(evt);
		} catch(pyjs_try_err) {
			var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
			$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjamas.DOM, try_lineno: 67};
			{
				$pyjs.__last_exception__.except_lineno = 71;
				err = pyjs_try_err;
			} 		}
	}
	listener = null;
	curElem = sender;
	cap = pyjamas.DOM.getCaptureElement();
	listener = pyjamas.DOM.get_listener(cap);
	if (pyjslib.bool((cap) && (listener))) {
		pyjamas.DOM.dispatchEvent(evt, cap, listener);
		evt.stopPropagation();
		return null;
	}
    while (pyjslib.bool((curElem) && (!(pyjamas.DOM.get_listener(curElem))))) {
	curElem = pyjamas.DOM.getParent(curElem);
    }
	if (pyjslib.bool((curElem) && (!pyjslib.eq(pyjamas.DOM.getNodeType(curElem), 1)))) {
		curElem = null;
	}
	listener = pyjamas.DOM.get_listener(curElem);
	if (pyjslib.bool(listener)) {
		pyjamas.DOM.dispatchEvent(evt, curElem, listener);
	}
	return null;
};
pyjamas.DOM._dispatchEvent.__name__ = '_dispatchEvent';

pyjamas.DOM._dispatchEvent.__bind_type__ = 0;
pyjamas.DOM._dispatchEvent.__args__ = [null,null,'sender', 'evt', 'useCap'];
pyjamas.DOM._dispatchCapturedMouseEvent = function(evt) {
	var listener,cap;
	if (pyjslib.bool(pyjamas.DOM._dispatchCapturedEvent(evt))) {
		cap = pyjamas.DOM.getCaptureElement();
		listener = pyjamas.DOM.get_listener(cap);
		if (pyjslib.bool((cap) && (listener))) {
			pyjamas.DOM.dispatchEvent(evt, cap, listener);
			evt.stopPropagation();
		}
	}
	return null;
};
pyjamas.DOM._dispatchCapturedMouseEvent.__name__ = '_dispatchCapturedMouseEvent';

pyjamas.DOM._dispatchCapturedMouseEvent.__bind_type__ = 0;
pyjamas.DOM._dispatchCapturedMouseEvent.__args__ = [null,null,'evt'];
pyjamas.DOM._dispatchCapturedMouseoutEvent = function(evt) {
	var listener,lcEvent,cap;
	cap = pyjamas.DOM.getCaptureElement();
	if (pyjslib.bool(cap)) {
		if (pyjslib.bool(!(pyjamas.DOM.eventGetToElement(evt)))) {
			pyjamas.DOM.setCapture(null);
			listener = pyjamas.DOM.get_listener(cap);
			if (pyjslib.bool(listener)) {
				lcEvent = $doc.createEvent(String('UIEvent'));
				lcEvent.initUIEvent(String('losecapture'), false, false, $wnd, 0);
				pyjamas.DOM.dispatchEvent(lcEvent, cap, listener);
			}
		}
	}
	return null;
};
pyjamas.DOM._dispatchCapturedMouseoutEvent.__name__ = '_dispatchCapturedMouseoutEvent';

pyjamas.DOM._dispatchCapturedMouseoutEvent.__bind_type__ = 0;
pyjamas.DOM._dispatchCapturedMouseoutEvent.__args__ = [null,null,'evt'];
pyjamas.DOM.browser_event_cb = function(view, event, from_window) {
	var err,pyjs_try_err,et;
	try {
		event = pyjamas.DOM.get_main_frame().gobject_wrap(event);
	} catch(pyjs_try_err) {
		var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
		$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjamas.DOM, try_lineno: 122};
		{
			$pyjs.__last_exception__.except_lineno = 125;
			err = pyjs_try_err;
		} 	}
	et = pyjamas.DOM.eventGetType(event);
	if (pyjslib.bool(pyjslib.eq(et, String('resize')))) {
		pyjamas.DOM.onResize();
		return null;
	}
	else if (pyjslib.bool(pyjslib.eq(et, String('mouseout')))) {
		return pyjamas.DOM._dispatchCapturedMouseoutEvent(event);
	}
	else if (pyjslib.bool((pyjslib.eq(et, String('keyup'))) || (pyjslib.eq(et, String('keydown'))) || (pyjslib.eq(et, String('keypress'))) || (pyjslib.eq(et, String('change'))))) {
		return pyjamas.DOM._dispatchCapturedEvent(event);
	}
	else {
		return pyjamas.DOM._dispatchCapturedMouseEvent(event);
	}
	return null;
};
pyjamas.DOM.browser_event_cb.__name__ = 'browser_event_cb';

pyjamas.DOM.browser_event_cb.__bind_type__ = 0;
pyjamas.DOM.browser_event_cb.__args__ = [null,null,'view', 'event', 'from_window'];
pyjamas.DOM._dispatchCapturedEvent = function(event) {

	if (pyjslib.bool(!(pyjamas.DOM.previewEvent(event)))) {
		event.stopPropagation();
		pyjamas.DOM.eventPreventDefault(event);
		return false;
	}
	return true;
};
pyjamas.DOM._dispatchCapturedEvent.__name__ = '_dispatchCapturedEvent';

pyjamas.DOM._dispatchCapturedEvent.__bind_type__ = 0;
pyjamas.DOM._dispatchCapturedEvent.__args__ = [null,null,'event'];
pyjamas.DOM.addEventPreview = function(preview) {

	pyjamas.DOM.sEventPreviewStack.append(preview);
	return null;
};
pyjamas.DOM.addEventPreview.__name__ = 'addEventPreview';

pyjamas.DOM.addEventPreview.__bind_type__ = 0;
pyjamas.DOM.addEventPreview.__args__ = [null,null,'preview'];
pyjamas.DOM.appendChild = function(parent, child) {

	parent.appendChild(child);
	return null;
};
pyjamas.DOM.appendChild.__name__ = 'appendChild';

pyjamas.DOM.appendChild.__bind_type__ = 0;
pyjamas.DOM.appendChild.__args__ = [null,null,'parent', 'child'];
pyjamas.DOM.buttonClick = function(button) {


    button.click();
    
};
pyjamas.DOM.buttonClick.__name__ = 'buttonClick';

pyjamas.DOM.buttonClick.__bind_type__ = 0;
pyjamas.DOM.buttonClick.__args__ = [null,null,'button'];
pyjamas.DOM.compare = function(elem1, elem2) {


    if (!elem1 && !elem2) {
        return true;
    } else if (!elem1 || !elem2) {
        return false;
    }
	if (!elem1.isSameNode) {
	    return (elem1 == elem2);
	}
    return (elem1.isSameNode(elem2));
    
};
pyjamas.DOM.compare.__name__ = 'compare';

pyjamas.DOM.compare.__bind_type__ = 0;
pyjamas.DOM.compare.__args__ = [null,null,'elem1', 'elem2'];
pyjamas.DOM.createAnchor = function() {

	return pyjamas.DOM.createElement(String('A'));
};
pyjamas.DOM.createAnchor.__name__ = 'createAnchor';

pyjamas.DOM.createAnchor.__bind_type__ = 0;
pyjamas.DOM.createAnchor.__args__ = [null,null];
pyjamas.DOM.createButton = function() {

	return pyjamas.DOM.createElement(String('button'));
};
pyjamas.DOM.createButton.__name__ = 'createButton';

pyjamas.DOM.createButton.__bind_type__ = 0;
pyjamas.DOM.createButton.__args__ = [null,null];
pyjamas.DOM.createCol = function() {

	return pyjamas.DOM.createElement(String('col'));
};
pyjamas.DOM.createCol.__name__ = 'createCol';

pyjamas.DOM.createCol.__bind_type__ = 0;
pyjamas.DOM.createCol.__args__ = [null,null];
pyjamas.DOM.createDiv = function() {

	return pyjamas.DOM.createElement(String('div'));
};
pyjamas.DOM.createDiv.__name__ = 'createDiv';

pyjamas.DOM.createDiv.__bind_type__ = 0;
pyjamas.DOM.createDiv.__args__ = [null,null];
pyjamas.DOM.createElement = function(tag) {


    return $doc.createElement(tag);
    
};
pyjamas.DOM.createElement.__name__ = 'createElement';

pyjamas.DOM.createElement.__bind_type__ = 0;
pyjamas.DOM.createElement.__args__ = [null,null,'tag'];
pyjamas.DOM.createFieldSet = function() {

	return pyjamas.DOM.createElement(String('fieldset'));
};
pyjamas.DOM.createFieldSet.__name__ = 'createFieldSet';

pyjamas.DOM.createFieldSet.__bind_type__ = 0;
pyjamas.DOM.createFieldSet.__args__ = [null,null];
pyjamas.DOM.createForm = function() {

	return pyjamas.DOM.createElement(String('form'));
};
pyjamas.DOM.createForm.__name__ = 'createForm';

pyjamas.DOM.createForm.__bind_type__ = 0;
pyjamas.DOM.createForm.__args__ = [null,null];
pyjamas.DOM.createIFrame = function() {

	return pyjamas.DOM.createElement(String('iframe'));
};
pyjamas.DOM.createIFrame.__name__ = 'createIFrame';

pyjamas.DOM.createIFrame.__bind_type__ = 0;
pyjamas.DOM.createIFrame.__args__ = [null,null];
pyjamas.DOM.createImg = function() {

	return pyjamas.DOM.createElement(String('img'));
};
pyjamas.DOM.createImg.__name__ = 'createImg';

pyjamas.DOM.createImg.__bind_type__ = 0;
pyjamas.DOM.createImg.__args__ = [null,null];
pyjamas.DOM.createInputCheck = function() {

	return pyjamas.DOM.createInputElement(String('checkbox'));
};
pyjamas.DOM.createInputCheck.__name__ = 'createInputCheck';

pyjamas.DOM.createInputCheck.__bind_type__ = 0;
pyjamas.DOM.createInputCheck.__args__ = [null,null];
pyjamas.DOM.createInputElement = function(elementType) {


    var e = $doc.createElement("INPUT");
    e.type = elementType;
    return e;
    
};
pyjamas.DOM.createInputElement.__name__ = 'createInputElement';

pyjamas.DOM.createInputElement.__bind_type__ = 0;
pyjamas.DOM.createInputElement.__args__ = [null,null,'elementType'];
pyjamas.DOM.createInputPassword = function() {

	return pyjamas.DOM.createInputElement(String('password'));
};
pyjamas.DOM.createInputPassword.__name__ = 'createInputPassword';

pyjamas.DOM.createInputPassword.__bind_type__ = 0;
pyjamas.DOM.createInputPassword.__args__ = [null,null];
pyjamas.DOM.createInputRadio = function(group) {


    var elem = $doc.createElement("INPUT");
    elem.type = 'radio';
    elem.name = group;
    return elem;
    
};
pyjamas.DOM.createInputRadio.__name__ = 'createInputRadio';

pyjamas.DOM.createInputRadio.__bind_type__ = 0;
pyjamas.DOM.createInputRadio.__args__ = [null,null,'group'];
pyjamas.DOM.createInputText = function() {

	return pyjamas.DOM.createInputElement(String('text'));
};
pyjamas.DOM.createInputText.__name__ = 'createInputText';

pyjamas.DOM.createInputText.__bind_type__ = 0;
pyjamas.DOM.createInputText.__args__ = [null,null];
pyjamas.DOM.createLabel = function() {

	return pyjamas.DOM.createElement(String('label'));
};
pyjamas.DOM.createLabel.__name__ = 'createLabel';

pyjamas.DOM.createLabel.__bind_type__ = 0;
pyjamas.DOM.createLabel.__args__ = [null,null];
pyjamas.DOM.createLegend = function() {

	return pyjamas.DOM.createElement(String('legend'));
};
pyjamas.DOM.createLegend.__name__ = 'createLegend';

pyjamas.DOM.createLegend.__bind_type__ = 0;
pyjamas.DOM.createLegend.__args__ = [null,null];
pyjamas.DOM.createOptions = function() {

	return pyjamas.DOM.createElement(String('options'));
};
pyjamas.DOM.createOptions.__name__ = 'createOptions';

pyjamas.DOM.createOptions.__bind_type__ = 0;
pyjamas.DOM.createOptions.__args__ = [null,null];
pyjamas.DOM.createSelect = function() {

	return pyjamas.DOM.createElement(String('select'));
};
pyjamas.DOM.createSelect.__name__ = 'createSelect';

pyjamas.DOM.createSelect.__bind_type__ = 0;
pyjamas.DOM.createSelect.__args__ = [null,null];
pyjamas.DOM.createSpan = function() {

	return pyjamas.DOM.createElement(String('span'));
};
pyjamas.DOM.createSpan.__name__ = 'createSpan';

pyjamas.DOM.createSpan.__bind_type__ = 0;
pyjamas.DOM.createSpan.__args__ = [null,null];
pyjamas.DOM.createTable = function() {

	return pyjamas.DOM.createElement(String('table'));
};
pyjamas.DOM.createTable.__name__ = 'createTable';

pyjamas.DOM.createTable.__bind_type__ = 0;
pyjamas.DOM.createTable.__args__ = [null,null];
pyjamas.DOM.createTBody = function() {

	return pyjamas.DOM.createElement(String('tbody'));
};
pyjamas.DOM.createTBody.__name__ = 'createTBody';

pyjamas.DOM.createTBody.__bind_type__ = 0;
pyjamas.DOM.createTBody.__args__ = [null,null];
pyjamas.DOM.createTD = function() {

	return pyjamas.DOM.createElement(String('td'));
};
pyjamas.DOM.createTD.__name__ = 'createTD';

pyjamas.DOM.createTD.__bind_type__ = 0;
pyjamas.DOM.createTD.__args__ = [null,null];
pyjamas.DOM.createTextArea = function() {

	return pyjamas.DOM.createElement(String('textarea'));
};
pyjamas.DOM.createTextArea.__name__ = 'createTextArea';

pyjamas.DOM.createTextArea.__bind_type__ = 0;
pyjamas.DOM.createTextArea.__args__ = [null,null];
pyjamas.DOM.createTH = function() {

	return pyjamas.DOM.createElement(String('th'));
};
pyjamas.DOM.createTH.__name__ = 'createTH';

pyjamas.DOM.createTH.__bind_type__ = 0;
pyjamas.DOM.createTH.__args__ = [null,null];
pyjamas.DOM.createTR = function() {

	return pyjamas.DOM.createElement(String('tr'));
};
pyjamas.DOM.createTR.__name__ = 'createTR';

pyjamas.DOM.createTR.__bind_type__ = 0;
pyjamas.DOM.createTR.__args__ = [null,null];
pyjamas.DOM.eventCancelBubble = function(evt, cancel) {

	evt.cancelBubble = cancel;
	return null;
};
pyjamas.DOM.eventCancelBubble.__name__ = 'eventCancelBubble';

pyjamas.DOM.eventCancelBubble.__bind_type__ = 0;
pyjamas.DOM.eventCancelBubble.__args__ = [null,null,'evt', 'cancel'];
pyjamas.DOM.eventGetAltKey = function(evt) {

	return evt.altKey;
};
pyjamas.DOM.eventGetAltKey.__name__ = 'eventGetAltKey';

pyjamas.DOM.eventGetAltKey.__bind_type__ = 0;
pyjamas.DOM.eventGetAltKey.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetButton = function(evt) {


    var button = evt.button;
    if(button == 0) {
        return 1;
    } else if (button == 1) {
        return 4;
    } else {
        return button;
    }
    
};
pyjamas.DOM.eventGetButton.__name__ = 'eventGetButton';

pyjamas.DOM.eventGetButton.__bind_type__ = 0;
pyjamas.DOM.eventGetButton.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetClientX = function(evt) {

	return evt.clientX;
};
pyjamas.DOM.eventGetClientX.__name__ = 'eventGetClientX';

pyjamas.DOM.eventGetClientX.__bind_type__ = 0;
pyjamas.DOM.eventGetClientX.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetClientY = function(evt) {

	return evt.clientY;
};
pyjamas.DOM.eventGetClientY.__name__ = 'eventGetClientY';

pyjamas.DOM.eventGetClientY.__bind_type__ = 0;
pyjamas.DOM.eventGetClientY.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetCtrlKey = function(evt) {

	return evt.ctrlKey;
};
pyjamas.DOM.eventGetCtrlKey.__name__ = 'eventGetCtrlKey';

pyjamas.DOM.eventGetCtrlKey.__bind_type__ = 0;
pyjamas.DOM.eventGetCtrlKey.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetFromElement = function(evt) {


    return evt.fromElement ? evt.fromElement : null;
    
};
pyjamas.DOM.eventGetFromElement.__name__ = 'eventGetFromElement';

pyjamas.DOM.eventGetFromElement.__bind_type__ = 0;
pyjamas.DOM.eventGetFromElement.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetKeyCode = function(evt) {


    return evt.which ? evt.which : (evt.keyCode ? evt.keyCode : 0);
    
};
pyjamas.DOM.eventGetKeyCode.__name__ = 'eventGetKeyCode';

pyjamas.DOM.eventGetKeyCode.__bind_type__ = 0;
pyjamas.DOM.eventGetKeyCode.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetRepeat = function(evt) {

	return evt.repeat;
};
pyjamas.DOM.eventGetRepeat.__name__ = 'eventGetRepeat';

pyjamas.DOM.eventGetRepeat.__bind_type__ = 0;
pyjamas.DOM.eventGetRepeat.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetScreenX = function(evt) {

	return evt.screenX;
};
pyjamas.DOM.eventGetScreenX.__name__ = 'eventGetScreenX';

pyjamas.DOM.eventGetScreenX.__bind_type__ = 0;
pyjamas.DOM.eventGetScreenX.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetScreenY = function(evt) {

	return evt.screenY;
};
pyjamas.DOM.eventGetScreenY.__name__ = 'eventGetScreenY';

pyjamas.DOM.eventGetScreenY.__bind_type__ = 0;
pyjamas.DOM.eventGetScreenY.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetShiftKey = function(evt) {

	return evt.shiftKey;
};
pyjamas.DOM.eventGetShiftKey.__name__ = 'eventGetShiftKey';

pyjamas.DOM.eventGetShiftKey.__bind_type__ = 0;
pyjamas.DOM.eventGetShiftKey.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetTarget = function(event) {


    return event.target ? event.target : null;
    
};
pyjamas.DOM.eventGetTarget.__name__ = 'eventGetTarget';

pyjamas.DOM.eventGetTarget.__bind_type__ = 0;
pyjamas.DOM.eventGetTarget.__args__ = [null,null,'event'];
pyjamas.DOM.eventGetToElement = function(evt) {


    return evt.relatedTarget ? evt.relatedTarget : null;
    
};
pyjamas.DOM.eventGetToElement.__name__ = 'eventGetToElement';

pyjamas.DOM.eventGetToElement.__bind_type__ = 0;
pyjamas.DOM.eventGetToElement.__args__ = [null,null,'evt'];
pyjamas.DOM.eventGetType = function(event) {

	return event.type;
};
pyjamas.DOM.eventGetType.__name__ = 'eventGetType';

pyjamas.DOM.eventGetType.__bind_type__ = 0;
pyjamas.DOM.eventGetType.__args__ = [null,null,'event'];
pyjamas.DOM.eventmap = new pyjslib.Dict([[String('blur'), 4096], [String('change'), 1024], [String('click'), 1], [String('dblclick'), 2], [String('focus'), 2048], [String('keydown'), 128], [String('keypress'), 256], [String('keyup'), 512], [String('load'), 32768], [String('losecapture'), 8192], [String('mousedown'), 4], [String('mousemove'), 64], [String('mouseout'), 32], [String('mouseover'), 16], [String('mouseup'), 8], [String('scroll'), 16384], [String('error'), 65536], [String('contextmenu'), 131072]]);
pyjamas.DOM.eventGetTypeInt = function(event) {


    switch (event.type) {
      case "blur": return 0x01000;
      case "change": return 0x00400;
      case "click": return 0x00001;
      case "dblclick": return 0x00002;
      case "focus": return 0x00800;
      case "keydown": return 0x00080;
      case "keypress": return 0x00100;
      case "keyup": return 0x00200;
      case "load": return 0x08000;
      case "losecapture": return 0x02000;
      case "mousedown": return 0x00004;
      case "mousemove": return 0x00040;
      case "mouseout": return 0x00020;
      case "mouseover": return 0x00010;
      case "mouseup": return 0x00008;
      case "scroll": return 0x04000;
      case "error": return 0x10000;
      case "contextmenu": return 0x20000;
    }
    
};
pyjamas.DOM.eventGetTypeInt.__name__ = 'eventGetTypeInt';

pyjamas.DOM.eventGetTypeInt.__bind_type__ = 0;
pyjamas.DOM.eventGetTypeInt.__args__ = [null,null,'event'];
pyjamas.DOM.eventGetTypeString = function(event) {

	return pyjamas.DOM.eventGetType(event);
};
pyjamas.DOM.eventGetTypeString.__name__ = 'eventGetTypeString';

pyjamas.DOM.eventGetTypeString.__bind_type__ = 0;
pyjamas.DOM.eventGetTypeString.__args__ = [null,null,'event'];
pyjamas.DOM.eventPreventDefault = function(evt) {

	evt.preventDefault();
	return null;
};
pyjamas.DOM.eventPreventDefault.__name__ = 'eventPreventDefault';

pyjamas.DOM.eventPreventDefault.__bind_type__ = 0;
pyjamas.DOM.eventPreventDefault.__args__ = [null,null,'evt'];
pyjamas.DOM.eventSetKeyCode = function(evt, key) {

	evt.keyCode = key;
	return null;
};
pyjamas.DOM.eventSetKeyCode.__name__ = 'eventSetKeyCode';

pyjamas.DOM.eventSetKeyCode.__bind_type__ = 0;
pyjamas.DOM.eventSetKeyCode.__args__ = [null,null,'evt', 'key'];
pyjamas.DOM.eventToString = function(evt) {


    return evt.toString();
    
};
pyjamas.DOM.eventToString.__name__ = 'eventToString';

pyjamas.DOM.eventToString.__bind_type__ = 0;
pyjamas.DOM.eventToString.__args__ = [null,null,'evt'];
pyjamas.DOM.iframeGetSrc = function(elem) {

	return elem.src;
};
pyjamas.DOM.iframeGetSrc.__name__ = 'iframeGetSrc';

pyjamas.DOM.iframeGetSrc.__bind_type__ = 0;
pyjamas.DOM.iframeGetSrc.__args__ = [null,null,'elem'];
pyjamas.DOM.getAbsoluteLeft = function(elem) {


    var left = 0;
    var parent = elem;

    while (parent) {
        if (parent.scrollLeft > 0) {
            left = left -  parent.scrollLeft;
        }
        parent = parent.parentNode;
    }
    while (elem) {
        left = left + elem.offsetLeft;
        elem = elem.offsetParent;
    }

    return left + $doc.body.scrollLeft + $doc.documentElement.scrollLeft;
    
};
pyjamas.DOM.getAbsoluteLeft.__name__ = 'getAbsoluteLeft';

pyjamas.DOM.getAbsoluteLeft.__bind_type__ = 0;
pyjamas.DOM.getAbsoluteLeft.__args__ = [null,null,'elem'];
pyjamas.DOM.getAbsoluteTop = function(elem) {


    var top = 0;
    var parent = elem;
    while (parent) {
        if (parent.scrollTop > 0) {
            top -= parent.scrollTop;
        }
        parent = parent.parentNode;
    }

    while (elem) {
        top += elem.offsetTop;
        elem = elem.offsetParent;
    }
    return top + $doc.body.scrollTop + $doc.documentElement.scrollTop;
    
};
pyjamas.DOM.getAbsoluteTop.__name__ = 'getAbsoluteTop';

pyjamas.DOM.getAbsoluteTop.__bind_type__ = 0;
pyjamas.DOM.getAbsoluteTop.__args__ = [null,null,'elem'];
pyjamas.DOM.getAttribute = function(elem, attr) {


    var ret = elem[attr];
    return (ret == null) ? null : String(ret);
    
};
pyjamas.DOM.getAttribute.__name__ = 'getAttribute';

pyjamas.DOM.getAttribute.__bind_type__ = 0;
pyjamas.DOM.getAttribute.__args__ = [null,null,'elem', 'attr'];
pyjamas.DOM.getElemAttribute = function(elem, attr) {
	var mf;
	mf = pyjamas.DOM.get_main_frame();
	if (pyjslib.bool(!(elem.hasAttribute(attr)))) {
		return pyjslib.str(pyjslib.getattr(elem, mf.mash_attrib(attr)));
	}
	return pyjslib.str(elem.getAttribute(attr));
};
pyjamas.DOM.getElemAttribute.__name__ = 'getElemAttribute';

pyjamas.DOM.getElemAttribute.__bind_type__ = 0;
pyjamas.DOM.getElemAttribute.__args__ = [null,null,'elem', 'attr'];
pyjamas.DOM.getBooleanAttribute = function(elem, attr) {


    return !!elem[attr];
    
};
pyjamas.DOM.getBooleanAttribute.__name__ = 'getBooleanAttribute';

pyjamas.DOM.getBooleanAttribute.__bind_type__ = 0;
pyjamas.DOM.getBooleanAttribute.__args__ = [null,null,'elem', 'attr'];
pyjamas.DOM.getBooleanElemAttribute = function(elem, attr) {

	if (pyjslib.bool(!(elem.hasAttribute(attr)))) {
		return null;
	}
	return pyjslib.bool(elem.getAttribute(attr));
};
pyjamas.DOM.getBooleanElemAttribute.__name__ = 'getBooleanElemAttribute';

pyjamas.DOM.getBooleanElemAttribute.__bind_type__ = 0;
pyjamas.DOM.getBooleanElemAttribute.__args__ = [null,null,'elem', 'attr'];
pyjamas.DOM.getCaptureElement = function() {

	return pyjamas.DOM.sCaptureElem;
};
pyjamas.DOM.getCaptureElement.__name__ = 'getCaptureElement';

pyjamas.DOM.getCaptureElement.__bind_type__ = 0;
pyjamas.DOM.getCaptureElement.__args__ = [null,null];
pyjamas.DOM.getChild = function(elem, index) {


    var count = 0, child = elem.firstChild;
    while (child) {
      var next = child.nextSibling;
      if (child.nodeType == 1) {
        if (index == count)
          return child;
        ++count;
      }
      child = next;
    }

    return null;
    
};
pyjamas.DOM.getChild.__name__ = 'getChild';

pyjamas.DOM.getChild.__bind_type__ = 0;
pyjamas.DOM.getChild.__args__ = [null,null,'elem', 'index'];
pyjamas.DOM.getChildCount = function(elem) {


    var count = 0, child = elem.firstChild;
    while (child) {
      if (child.nodeType == 1)
      ++count;
      child = child.nextSibling;
    }
    return count;
    
};
pyjamas.DOM.getChildCount.__name__ = 'getChildCount';

pyjamas.DOM.getChildCount.__bind_type__ = 0;
pyjamas.DOM.getChildCount.__args__ = [null,null,'elem'];
pyjamas.DOM.getChildIndex = function(parent, child) {


    var count = 0, current = parent.firstChild;
    while (current) {
		if (! current.isSameNode) {
			if (current == child) {
			   return count;
		   }
		}
        else if (current.isSameNode(child)) {
            return count;
        }
        if (current.nodeType == 1) {
            ++count;
        }
        current = current.nextSibling;
    }
    return -1;
    
};
pyjamas.DOM.getChildIndex.__name__ = 'getChildIndex';

pyjamas.DOM.getChildIndex.__bind_type__ = 0;
pyjamas.DOM.getChildIndex.__args__ = [null,null,'parent', 'child'];
pyjamas.DOM.getElementById = function(id) {


    var elem = $doc.getElementById(id);
    return elem ? elem : null;
    
};
pyjamas.DOM.getElementById.__name__ = 'getElementById';

pyjamas.DOM.getElementById.__bind_type__ = 0;
pyjamas.DOM.getElementById.__args__ = [null,null,'id'];
pyjamas.DOM.getEventListener = function(element) {


    return element.__listener;
    
};
pyjamas.DOM.getEventListener.__name__ = 'getEventListener';

pyjamas.DOM.getEventListener.__bind_type__ = 0;
pyjamas.DOM.getEventListener.__args__ = [null,null,'element'];
pyjamas.DOM.eventbitsmap = new pyjslib.Dict([]);
pyjamas.DOM.getEventsSunk = function(element) {


    return element.__eventBits ? element.__eventBits : 0;
    
};
pyjamas.DOM.getEventsSunk.__name__ = 'getEventsSunk';

pyjamas.DOM.getEventsSunk.__bind_type__ = 0;
pyjamas.DOM.getEventsSunk.__args__ = [null,null,'element'];
pyjamas.DOM.getFirstChild = function(elem) {


    var child = elem.firstChild;
    while (child && child.nodeType != 1)
      child = child.nextSibling;
    return child ? child : null;
    
};
pyjamas.DOM.getFirstChild.__name__ = 'getFirstChild';

pyjamas.DOM.getFirstChild.__bind_type__ = 0;
pyjamas.DOM.getFirstChild.__args__ = [null,null,'elem'];
pyjamas.DOM.getInnerHTML = function(element) {


    var ret = element.innerHTML;
    return (ret == null) ? null : ret;
    
};
pyjamas.DOM.getInnerHTML.__name__ = 'getInnerHTML';

pyjamas.DOM.getInnerHTML.__bind_type__ = 0;
pyjamas.DOM.getInnerHTML.__args__ = [null,null,'element'];
pyjamas.DOM.getInnerText = function(element) {


    // To mimic IE's 'innerText' property in the W3C DOM, we need to recursively
    // concatenate all child text nodes (depth first).
    var text = '', child = element.firstChild;
    while (child) {
      if (child.nodeType == 1){ // 1 == Element node
        text += DOM.getInnerText(child);
      } else if (child.nodeValue) {
        text += child.nodeValue;
      }
      child = child.nextSibling;
    }
    return text;
    
};
pyjamas.DOM.getInnerText.__name__ = 'getInnerText';

pyjamas.DOM.getInnerText.__bind_type__ = 0;
pyjamas.DOM.getInnerText.__args__ = [null,null,'element'];
pyjamas.DOM.getIntAttribute = function(elem, attr) {


    var i = parseInt(elem[attr]);
    if (!i) {
        return 0;
    }
    return i;
    
};
pyjamas.DOM.getIntAttribute.__name__ = 'getIntAttribute';

pyjamas.DOM.getIntAttribute.__bind_type__ = 0;
pyjamas.DOM.getIntAttribute.__args__ = [null,null,'elem', 'attr'];
pyjamas.DOM.getIntElemAttribute = function(elem, attr) {

	if (pyjslib.bool(!(elem.hasAttribute(attr)))) {
		return null;
	}
	return pyjslib.int_(elem.getAttribute(attr));
};
pyjamas.DOM.getIntElemAttribute.__name__ = 'getIntElemAttribute';

pyjamas.DOM.getIntElemAttribute.__bind_type__ = 0;
pyjamas.DOM.getIntElemAttribute.__args__ = [null,null,'elem', 'attr'];
pyjamas.DOM.getIntStyleAttribute = function(elem, attr) {


    var i = parseInt(elem.style[attr]);
    if (!i) {
        return 0;
    }
    return i;
    
};
pyjamas.DOM.getIntStyleAttribute.__name__ = 'getIntStyleAttribute';

pyjamas.DOM.getIntStyleAttribute.__bind_type__ = 0;
pyjamas.DOM.getIntStyleAttribute.__args__ = [null,null,'elem', 'attr'];
pyjamas.DOM.getNextSibling = function(elem) {


    var sib = elem.nextSibling;
    while (sib && sib.nodeType != 1)
      sib = sib.nextSibling;
    return sib ? sib : null;
    
};
pyjamas.DOM.getNextSibling.__name__ = 'getNextSibling';

pyjamas.DOM.getNextSibling.__bind_type__ = 0;
pyjamas.DOM.getNextSibling.__args__ = [null,null,'elem'];
pyjamas.DOM.getNodeType = function(elem) {

	return elem.nodeType;
};
pyjamas.DOM.getNodeType.__name__ = 'getNodeType';

pyjamas.DOM.getNodeType.__bind_type__ = 0;
pyjamas.DOM.getNodeType.__args__ = [null,null,'elem'];
pyjamas.DOM.getParent = function(elem) {


    var parent = elem.parentNode;
    if(parent == null) {
        return null;
    }
    if (parent.nodeType != 1)
        parent = null;
    return parent ? parent : null;
    
};
pyjamas.DOM.getParent.__name__ = 'getParent';

pyjamas.DOM.getParent.__bind_type__ = 0;
pyjamas.DOM.getParent.__args__ = [null,null,'elem'];
pyjamas.DOM.getStyleAttribute = function(elem, attr) {


    var ret = elem.style[attr];
    return (ret == null) ? null : ret;
    
};
pyjamas.DOM.getStyleAttribute.__name__ = 'getStyleAttribute';

pyjamas.DOM.getStyleAttribute.__bind_type__ = 0;
pyjamas.DOM.getStyleAttribute.__args__ = [null,null,'elem', 'attr'];
pyjamas.DOM.insertChild = function(parent, toAdd, index) {


    var count = 0, child = parent.firstChild, before = null;
    while (child) {
      if (child.nodeType == 1) {
        if (count == index) {
          before = child;
          break;
        }
        ++count;
      }
      child = child.nextSibling;
    }

    parent.insertBefore(toAdd, before);
    
};
pyjamas.DOM.insertChild.__name__ = 'insertChild';

pyjamas.DOM.insertChild.__bind_type__ = 0;
pyjamas.DOM.insertChild.__args__ = [null,null,'parent', 'toAdd', 'index'];
pyjamas.DOM.IterChildrenClass = (function(){
	var cls_instance = pyjs__class_instance('IterChildrenClass');
	var cls_definition = new Object();
	cls_definition.__md5__ = '489078ab9346a71aed9ea86c931780b7';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(elem) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			elem = arguments[1];
		}

		self.parent = elem;
		self.child = elem.firstChild;
		self.lastChild = null;
		return null;
	}
	, 1, [null,null,'self', 'elem']);
	cls_definition.next = pyjs__bind_method(cls_instance, 'next', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool(!(self.child))) {
			throw (pyjslib.StopIteration);
		}
		self.lastChild = self.child;
		self.child = pyjamas.DOM.getNextSibling(self.child);
		return self.lastChild;
	}
	, 1, [null,null,'self']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.parent.removeChild(self.lastChild);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjamas.DOM.iterChildren = function(elem) {


    var parent = elem;
    var child = elem.firstChild;
    var lastChild = null;
    return {
        'next': function() {
            if (child == null) {
                throw pyjslib.StopIteration;
            }
            lastChild = child;
            child = DOM.getNextSibling(child);
            return lastChild;
        },
        'remove': function() {        
            parent.removeChild(lastChild);
        },
        __iter__: function() {
            return this;
        }
    };
    
};
pyjamas.DOM.iterChildren.__name__ = 'iterChildren';

pyjamas.DOM.iterChildren.__bind_type__ = 0;
pyjamas.DOM.iterChildren.__args__ = [null,null,'elem'];
pyjamas.DOM.IterWalkChildren = (function(){
	var cls_instance = pyjs__class_instance('IterWalkChildren');
	var cls_definition = new Object();
	cls_definition.__md5__ = '18e9b8712b2b33b294d754aa7c86bc4b';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(elem) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			elem = arguments[1];
		}

		self.parent = elem;
		self.child = pyjamas.DOM.getFirstChild(elem);
		self.lastChild = null;
		self.stack = new pyjslib.List([]);
		return null;
	}
	, 1, [null,null,'self', 'elem']);
	cls_definition.next = pyjs__bind_method(cls_instance, 'next', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var nextSibling,firstChild;
		if (pyjslib.bool(!(self.child))) {
			throw (pyjslib.StopIteration);
		}
		self.lastChild = self.child;
		firstChild = pyjamas.DOM.getFirstChild(self.child);
		nextSibling = pyjamas.DOM.getNextSibling(self.child);
		if (pyjslib.bool((firstChild !== null))) {
			if (pyjslib.bool((nextSibling !== null))) {
				self.stack.append(new pyjslib.Tuple([nextSibling, self.parent]));
			}
			self.parent = self.child;
			self.child = firstChild;
		}
		else if (pyjslib.bool((nextSibling !== null))) {
			self.child = nextSibling;
		}
		else if (pyjslib.bool((pyjslib.cmp(pyjslib.len(self.stack), 0) == 1))) {
			var __tupleassign__000001 = self.stack.pop();
			self.child = __tupleassign__000001.__getitem__(0);
			self.parent = __tupleassign__000001.__getitem__(1);
		}
		else {
			self.child = null;
		}
		return self.lastChild;
	}
	, 1, [null,null,'self']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.parent.removeChild(self.lastChild);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
pyjamas.DOM.walkChildren = function(elem) {


    var parent = elem;
    var child = DOM.getFirstChild(elem);
    var lastChild = null;
    var stack = [];
    var parentStack = [];
    return {
        'next': function() {
            if (child == null) {
                throw pyjslib.StopIteration;
            }
            lastChild = child;
            var firstChild = DOM.getFirstChild(child);
            var nextSibling = DOM.getNextSibling(child);
            if(firstChild != null) {
               if(nextSibling != null) {
                   stack.push(nextSibling);
                   parentStack.push(parent);
                }
                parent = child;
                child = firstChild;
            } else if(nextSibling != null) {
                child = nextSibling;
            } else if(stack.length > 0) {
                child = stack.pop();
                parent = parentStack.pop();
            } else {
                child = null;
            }
            return lastChild;
        },
        'remove': function() {        
            parent.removeChild(lastChild);
        },
        __iter__: function() {
            return this;
        }
    };
    
};
pyjamas.DOM.walkChildren.__name__ = 'walkChildren';

pyjamas.DOM.walkChildren.__bind_type__ = 0;
pyjamas.DOM.walkChildren.__args__ = [null,null,'elem'];
pyjamas.DOM.isOrHasChild = function(parent, child) {


    while (child) {
		if ((!parent.isSameNode)) {
			if (parent == child) {
			   return true;
			}
		}
		else if (parent.isSameNode(child)) {
            return true;
        }
        child = child.parentNode;
        if (child && child.nodeType != 1) {
            child = null;
        }
    }
    return false;
    
};
pyjamas.DOM.isOrHasChild.__name__ = 'isOrHasChild';

pyjamas.DOM.isOrHasChild.__bind_type__ = 0;
pyjamas.DOM.isOrHasChild.__args__ = [null,null,'parent', 'child'];
pyjamas.DOM.releaseCapture = function(elem) {


    if ((DOM.sCaptureElem != null) && DOM.compare(elem, DOM.sCaptureElem))
        DOM.sCaptureElem = null;
    
	if (!elem.isSameNode) {
		if (elem == $wnd.__captureElem) {
			$wnd.__captureElem = null;
		}
	}
	else if (elem.isSameNode($wnd.__captureElem)) {
        $wnd.__captureElem = null;
    }
    
};
pyjamas.DOM.releaseCapture.__name__ = 'releaseCapture';

pyjamas.DOM.releaseCapture.__bind_type__ = 0;
pyjamas.DOM.releaseCapture.__args__ = [null,null,'elem'];
pyjamas.DOM.removeChild = function(parent, child) {

	parent.removeChild(child);
	return null;
};
pyjamas.DOM.removeChild.__name__ = 'removeChild';

pyjamas.DOM.removeChild.__bind_type__ = 0;
pyjamas.DOM.removeChild.__args__ = [null,null,'parent', 'child'];
pyjamas.DOM.replaceChild = function(parent, newChild, oldChild) {

	parent.replaceChild(newChild, oldChild);
	return null;
};
pyjamas.DOM.replaceChild.__name__ = 'replaceChild';

pyjamas.DOM.replaceChild.__bind_type__ = 0;
pyjamas.DOM.replaceChild.__args__ = [null,null,'parent', 'newChild', 'oldChild'];
pyjamas.DOM.removeEventPreview = function(preview) {

	pyjamas.DOM.sEventPreviewStack.remove(preview);
	return null;
};
pyjamas.DOM.removeEventPreview.__name__ = 'removeEventPreview';

pyjamas.DOM.removeEventPreview.__bind_type__ = 0;
pyjamas.DOM.removeEventPreview.__args__ = [null,null,'preview'];
pyjamas.DOM.scrollIntoView = function(elem) {


    var left = elem.offsetLeft, top = elem.offsetTop;
    var width = elem.offsetWidth, height = elem.offsetHeight;
    
    if (elem.parentNode != elem.offsetParent) {
        left -= elem.parentNode.offsetLeft;
        top -= elem.parentNode.offsetTop;
    }

    var cur = elem.parentNode;
    while (cur && (cur.nodeType == 1)) {
        if ((cur.style.overflow == 'auto') || (cur.style.overflow == 'scroll')) {
            if (left < cur.scrollLeft) {
                cur.scrollLeft = left;
            }
            if (left + width > cur.scrollLeft + cur.clientWidth) {
                cur.scrollLeft = (left + width) - cur.clientWidth;
            }
            if (top < cur.scrollTop) {
                cur.scrollTop = top;
            }
            if (top + height > cur.scrollTop + cur.clientHeight) {
                cur.scrollTop = (top + height) - cur.clientHeight;
            }
        }

        var offsetLeft = cur.offsetLeft, offsetTop = cur.offsetTop;
        if (cur.parentNode != cur.offsetParent) {
            offsetLeft -= cur.parentNode.offsetLeft;
            offsetTop -= cur.parentNode.offsetTop;
        }

        left += offsetLeft - cur.scrollLeft;
        top += offsetTop - cur.scrollTop;
        cur = cur.parentNode;
    }
    
};
pyjamas.DOM.scrollIntoView.__name__ = 'scrollIntoView';

pyjamas.DOM.scrollIntoView.__bind_type__ = 0;
pyjamas.DOM.scrollIntoView.__args__ = [null,null,'elem'];
pyjamas.DOM.mash_name_for_glib = function(name, joiner) {
	if (typeof joiner == 'undefined') joiner=String('-');
	var res,c;
	res = String('');
	var __c = name.__iter__();
	try {
		while (true) {
			var c = __c.next();
			
			if (pyjslib.bool(c.isupper())) {
				res +=  ( joiner + c.lower() ) ;
			}
			else {
				res += c;
			}
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return res;
};
pyjamas.DOM.mash_name_for_glib.__name__ = 'mash_name_for_glib';

pyjamas.DOM.mash_name_for_glib.__bind_type__ = 0;
pyjamas.DOM.mash_name_for_glib.__args__ = [null,null,'name', 'joiner'];
pyjamas.DOM.removeAttribute = function(element, attribute) {


    delete element[attribute];
    
};
pyjamas.DOM.removeAttribute.__name__ = 'removeAttribute';

pyjamas.DOM.removeAttribute.__bind_type__ = 0;
pyjamas.DOM.removeAttribute.__args__ = [null,null,'element', 'attribute'];
pyjamas.DOM.setAttribute = function(element, attribute, value) {


    element[attribute] = value;
    
};
pyjamas.DOM.setAttribute.__name__ = 'setAttribute';

pyjamas.DOM.setAttribute.__bind_type__ = 0;
pyjamas.DOM.setAttribute.__args__ = [null,null,'element', 'attribute', 'value'];
pyjamas.DOM.setElemAttribute = function(element, attribute, value) {

	element.setAttribute(attribute, value);
	return null;
};
pyjamas.DOM.setElemAttribute.__name__ = 'setElemAttribute';

pyjamas.DOM.setElemAttribute.__bind_type__ = 0;
pyjamas.DOM.setElemAttribute.__args__ = [null,null,'element', 'attribute', 'value'];
pyjamas.DOM.setBooleanAttribute = function(elem, attr, value) {


    elem[attr] = value;
    
};
pyjamas.DOM.setBooleanAttribute.__name__ = 'setBooleanAttribute';

pyjamas.DOM.setBooleanAttribute.__bind_type__ = 0;
pyjamas.DOM.setBooleanAttribute.__args__ = [null,null,'elem', 'attr', 'value'];
pyjamas.DOM.setCapture = function(elem) {


    DOM.sCaptureElem = elem;
    
};
pyjamas.DOM.setCapture.__name__ = 'setCapture';

pyjamas.DOM.setCapture.__bind_type__ = 0;
pyjamas.DOM.setCapture.__args__ = [null,null,'elem'];
pyjamas.DOM.setEventListener = function(element, listener) {


    element.__listener = listener;
    
};
pyjamas.DOM.setEventListener.__name__ = 'setEventListener';

pyjamas.DOM.setEventListener.__bind_type__ = 0;
pyjamas.DOM.setEventListener.__args__ = [null,null,'element', 'listener'];
pyjamas.DOM.setInnerHTML = function(element, html) {


    if (!html) {
        html = "";
    }
    element.innerHTML = html;
    
};
pyjamas.DOM.setInnerHTML.__name__ = 'setInnerHTML';

pyjamas.DOM.setInnerHTML.__bind_type__ = 0;
pyjamas.DOM.setInnerHTML.__args__ = [null,null,'element', 'html'];
pyjamas.DOM.setInnerText = function(elem, text) {


    // Remove all children first.
    while (elem.firstChild) {
        elem.removeChild(elem.firstChild);
    }
    // Add a new text node.
    elem.appendChild($doc.createTextNode(text));
    
};
pyjamas.DOM.setInnerText.__name__ = 'setInnerText';

pyjamas.DOM.setInnerText.__bind_type__ = 0;
pyjamas.DOM.setInnerText.__args__ = [null,null,'elem', 'text'];
pyjamas.DOM.setIntElemAttribute = function(elem, attr, value) {

	elem.setAttribute(attr, pyjslib.str(value));
	return null;
};
pyjamas.DOM.setIntElemAttribute.__name__ = 'setIntElemAttribute';

pyjamas.DOM.setIntElemAttribute.__bind_type__ = 0;
pyjamas.DOM.setIntElemAttribute.__args__ = [null,null,'elem', 'attr', 'value'];
pyjamas.DOM.setIntAttribute = function(elem, attr, value) {


    elem[attr] = value;
    
};
pyjamas.DOM.setIntAttribute.__name__ = 'setIntAttribute';

pyjamas.DOM.setIntAttribute.__bind_type__ = 0;
pyjamas.DOM.setIntAttribute.__args__ = [null,null,'elem', 'attr', 'value'];
pyjamas.DOM.setIntStyleAttribute = function(elem, attr, value) {


    elem.style[attr] = value;
    
};
pyjamas.DOM.setIntStyleAttribute.__name__ = 'setIntStyleAttribute';

pyjamas.DOM.setIntStyleAttribute.__bind_type__ = 0;
pyjamas.DOM.setIntStyleAttribute.__args__ = [null,null,'elem', 'attr', 'value'];
pyjamas.DOM.setOptionText = function(select, text, index) {
	var option;
	option = select.options.item(index);
	option.text = text;
	return null;
};
pyjamas.DOM.setOptionText.__name__ = 'setOptionText';

pyjamas.DOM.setOptionText.__bind_type__ = 0;
pyjamas.DOM.setOptionText.__args__ = [null,null,'select', 'text', 'index'];
pyjamas.DOM.setStyleAttribute = function(element, name, value) {


    element.style[name] = value;
    
};
pyjamas.DOM.setStyleAttribute.__name__ = 'setStyleAttribute';

pyjamas.DOM.setStyleAttribute.__bind_type__ = 0;
pyjamas.DOM.setStyleAttribute.__args__ = [null,null,'element', 'name', 'value'];
pyjamas.DOM.sinkEvents = function(element, bits) {


    element.__eventBits = bits;
    
    element.onclick    = (bits & 0x00001) ? $wnd.__dispatchEvent : null;
    element.ondblclick  = (bits & 0x00002) ? $wnd.__dispatchEvent : null;
    element.onmousedown   = (bits & 0x00004) ? $wnd.__dispatchEvent : null;
    element.onmouseup    = (bits & 0x00008) ? $wnd.__dispatchEvent : null;
    element.onmouseover   = (bits & 0x00010) ? $wnd.__dispatchEvent : null;
    element.onmouseout  = (bits & 0x00020) ? $wnd.__dispatchEvent : null;
    element.onmousemove   = (bits & 0x00040) ? $wnd.__dispatchEvent : null;
    element.onkeydown    = (bits & 0x00080) ? $wnd.__dispatchEvent : null;
    element.onkeypress  = (bits & 0x00100) ? $wnd.__dispatchEvent : null;
    element.onkeyup    = (bits & 0x00200) ? $wnd.__dispatchEvent : null;
    element.onchange      = (bits & 0x00400) ? $wnd.__dispatchEvent : null;
    element.onfocus    = (bits & 0x00800) ? $wnd.__dispatchEvent : null;
    element.onblur      = (bits & 0x01000) ? $wnd.__dispatchEvent : null;
    element.onlosecapture = (bits & 0x02000) ? $wnd.__dispatchEvent : null;
    element.onscroll      = (bits & 0x04000) ? $wnd.__dispatchEvent : null;
    element.onload      = (bits & 0x08000) ? $wnd.__dispatchEvent : null;
    element.onerror    = (bits & 0x10000) ? $wnd.__dispatchEvent : null;
    element.oncontextmenu = (bits & 0x20000) ? $wnd.__dispatchEvent : null;
    
};
pyjamas.DOM.sinkEvents.__name__ = 'sinkEvents';

pyjamas.DOM.sinkEvents.__bind_type__ = 0;
pyjamas.DOM.sinkEvents.__args__ = [null,null,'element', 'bits'];
pyjamas.DOM.toString = function(elem) {


    var temp = elem.cloneNode(true);
    var tempDiv = $doc.createElement("DIV");
    tempDiv.appendChild(temp);
    outer = tempDiv.innerHTML;
    temp.innerHTML = "";
    return outer;
    
};
pyjamas.DOM.toString.__name__ = 'toString';

pyjamas.DOM.toString.__bind_type__ = 0;
pyjamas.DOM.toString.__args__ = [null,null,'elem'];
pyjamas.DOM.dispatchEvent = function(event, element, listener) {

	pyjamas.DOM.dispatchEventImpl(event, element, listener);
	return null;
};
pyjamas.DOM.dispatchEvent.__name__ = 'dispatchEvent';

pyjamas.DOM.dispatchEvent.__bind_type__ = 0;
pyjamas.DOM.dispatchEvent.__args__ = [null,null,'event', 'element', 'listener'];
pyjamas.DOM.previewEvent = function(evt) {
	var preview,ret;
	ret = true;
	if (pyjslib.bool((pyjslib.cmp(pyjslib.len(pyjamas.DOM.sEventPreviewStack), 0) == 1))) {
		preview = pyjamas.DOM.sEventPreviewStack.__getitem__( ( pyjslib.len(pyjamas.DOM.sEventPreviewStack) - 1 ) );
		ret = preview.onEventPreview(evt);
		if (pyjslib.bool(!(ret))) {
			pyjamas.DOM.eventCancelBubble(evt, true);
			pyjamas.DOM.eventPreventDefault(evt);
		}
	}
	return ret;
};
pyjamas.DOM.previewEvent.__name__ = 'previewEvent';

pyjamas.DOM.previewEvent.__bind_type__ = 0;
pyjamas.DOM.previewEvent.__args__ = [null,null,'evt'];
pyjamas.DOM.dispatchEventAndCatch = function(evt, elem, listener, handler) {

 	return null;
};
pyjamas.DOM.dispatchEventAndCatch.__name__ = 'dispatchEventAndCatch';

pyjamas.DOM.dispatchEventAndCatch.__bind_type__ = 0;
pyjamas.DOM.dispatchEventAndCatch.__args__ = [null,null,'evt', 'elem', 'listener', 'handler'];
pyjamas.DOM.currentEvent = null;
pyjamas.DOM.dispatchEventImpl = function(event, element, listener) {
	var prevCurrentEvent;
	if (pyjslib.bool(pyjslib.eq(element, pyjamas.DOM.sCaptureElem))) {
		if (pyjslib.bool(pyjslib.eq(pyjamas.DOM.eventGetType(event), String('losecapture')))) {
			pyjamas.DOM.sCaptureElem = null;
		}
	}
	prevCurrentEvent = pyjamas.DOM.currentEvent;
	pyjamas.DOM.currentEvent = event;
	listener.onBrowserEvent(event);
	pyjamas.DOM.currentEvent = prevCurrentEvent;
	return null;
};
pyjamas.DOM.dispatchEventImpl.__name__ = 'dispatchEventImpl';

pyjamas.DOM.dispatchEventImpl.__bind_type__ = 0;
pyjamas.DOM.dispatchEventImpl.__args__ = [null,null,'event', 'element', 'listener'];
pyjamas.DOM.eventGetCurrentEvent = function() {

	return pyjamas.DOM.currentEvent;
};
pyjamas.DOM.eventGetCurrentEvent.__name__ = 'eventGetCurrentEvent';

pyjamas.DOM.eventGetCurrentEvent.__bind_type__ = 0;
pyjamas.DOM.eventGetCurrentEvent.__args__ = [null,null];
pyjamas.DOM.insertListItem = function(select, item, value, index) {
	var option;
	option = pyjamas.DOM.createElement(String('OPTION'));
	pyjamas.DOM.setInnerText(option, item);
	if (pyjslib.bool((value !== null))) {
		pyjamas.DOM.setAttribute(option, String('value'), value);
	}
	if (pyjslib.bool(pyjslib.eq(index, -1))) {
		pyjamas.DOM.appendChild(select, option);
	}
	else {
		pyjamas.DOM.insertChild(select, option, index);
	}
	return null;
};
pyjamas.DOM.insertListItem.__name__ = 'insertListItem';

pyjamas.DOM.insertListItem.__bind_type__ = 0;
pyjamas.DOM.insertListItem.__args__ = [null,null,'select', 'item', 'value', 'index'];
pyjamas.DOM.getBodyOffsetTop = function() {

	return 0;
};
pyjamas.DOM.getBodyOffsetTop.__name__ = 'getBodyOffsetTop';

pyjamas.DOM.getBodyOffsetTop.__bind_type__ = 0;
pyjamas.DOM.getBodyOffsetTop.__args__ = [null,null];
pyjamas.DOM.getBodyOffsetLeft = function() {

	return 0;
};
pyjamas.DOM.getBodyOffsetLeft.__name__ = 'getBodyOffsetLeft';

pyjamas.DOM.getBodyOffsetLeft.__bind_type__ = 0;
pyjamas.DOM.getBodyOffsetLeft.__args__ = [null,null];
if (pyjslib.bool(new pyjslib.List([String('mozilla'), String('ie6'), String('opera'), String('oldmoz'), String('safari')]).__contains__(pyjamas.DOM.sys.platform))) {
	pyjamas.DOM.init();
}
return this;
}; /* end pyjamas.DOM */
$pyjs.modules_hash['pyjamas.DOM'] = $pyjs.loaded_modules['pyjamas.DOM'];


 /* end module: pyjamas.DOM */


/*
PYJS_DEPS: ['sys', 'pyjamas.Window.onResize', 'pyjamas', 'pyjamas.Window', 'pyjamas.Window.onClosing', 'pyjamas.Window.onClosed']
*/

/* start module: pyjamas.ui.SimplePanel */
pyjamas.ui.SimplePanel = $pyjs.loaded_modules["pyjamas.ui.SimplePanel"] = function (__mod_name__) {
if(pyjamas.ui.SimplePanel.__was_initialized__) return pyjamas.ui.SimplePanel;
pyjamas.ui.SimplePanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.SimplePanel';
var __name__ = pyjamas.ui.SimplePanel.__name__ = __mod_name__;
var SimplePanel = pyjamas.ui.SimplePanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.SimplePanel');
pyjamas.ui.SimplePanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Panel.Panel', 'pyjamas.ui.pyjamas.ui.Panel', 'pyjamas.ui.Panel.Panel', 'pyjamas.ui.Panel'], 'pyjamas.ui.Panel.Panel', 'pyjamas.ui.SimplePanel');
pyjamas.ui.SimplePanel.Panel = $pyjs.__modules__.pyjamas.ui.Panel.Panel;
pyjamas.ui.SimplePanel.SimplePanel = (function(){
	var cls_instance = pyjs__class_instance('SimplePanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = '7a0848ea1fb2a7d57a1d675302f8cb78';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			element = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof element != 'undefined') {
				if (pyjslib.get_pyjs_classtype(element) == 'Dict') {
					kwargs = element;
					element = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}
		if (typeof element == 'undefined') element=null;

		if (pyjslib.bool((element === null))) {
			element = pyjamas.ui.SimplePanel.DOM.createDiv();
		}
		self.setElement(element);
		pyjs_kwargs_call(pyjamas.ui.SimplePanel.Panel, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self', 'element']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool((self.getWidget() !== null))) {
			console.error(String('SimplePanel can only contain one child widget'));
			return null;
		}
		self.setWidget(widget);
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.getWidget = pyjs__bind_method(cls_instance, 'getWidget', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool(pyjslib.len(self.children))) {
			return self.children.__getitem__(0);
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool(!pyjslib.eq(self.getWidget(), widget))) {
			return false;
		}
		self.disown(widget);
    self.children.__delitem__(0);
		return true;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.getContainerElement = pyjs__bind_method(cls_instance, 'getContainerElement', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.getElement();
	}
	, 1, [null,null,'self']);
	cls_definition.setWidget = pyjs__bind_method(cls_instance, 'setWidget', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool(pyjslib.eq(self.getWidget(), widget))) {
			return null;
		}
		if (pyjslib.bool((self.getWidget() !== null))) {
			self.remove(self.getWidget());
		}
		if (pyjslib.bool((widget !== null))) {
			self.adopt(widget, self.getContainerElement());
			self.children.append(widget);
		}
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.SimplePanel.Panel));
})();
return this;
}; /* end pyjamas.ui.SimplePanel */
$pyjs.modules_hash['pyjamas.ui.SimplePanel'] = $pyjs.loaded_modules['pyjamas.ui.SimplePanel'];


 /* end module: pyjamas.ui.SimplePanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Panel.Panel', 'pyjamas.ui', 'pyjamas.ui.Panel']
*/

/* start module: pyjamas.ui.Panel */
pyjamas.ui.Panel = $pyjs.loaded_modules["pyjamas.ui.Panel"] = function (__mod_name__) {
if(pyjamas.ui.Panel.__was_initialized__) return pyjamas.ui.Panel;
pyjamas.ui.Panel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Panel';
var __name__ = pyjamas.ui.Panel.__name__ = __mod_name__;
var Panel = pyjamas.ui.Panel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.Panel');
pyjamas.ui.Panel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Widget.Widget', 'pyjamas.ui.pyjamas.ui.Widget', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Widget'], 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Panel');
pyjamas.ui.Panel.Widget = $pyjs.__modules__.pyjamas.ui.Widget.Widget;
pyjamas.ui.Panel.Panel = (function(){
	var cls_instance = pyjs__class_instance('Panel');
	var cls_definition = new Object();
	cls_definition.__md5__ = '93ef64a0f0ab32e3914011ce88595102';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		self.children = new pyjslib.List([]);
		pyjs_kwargs_call(pyjamas.ui.Panel.Widget, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		console.error(String('This panel does not support no-arg add()'));
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.clear = pyjs__bind_method(cls_instance, 'clear', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var children,child;
		children = new pyjslib.List([]);
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				children.append(child);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		var __child = children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				self.remove(child);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.disown = pyjs__bind_method(cls_instance, 'disown', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}
		var parentElement,element;
		if (pyjslib.bool(!pyjslib.eq(widget.getParent(), self))) {
			console.error(String('widget %o is not a child of this panel %o'), widget, self);
		}
		else {
			element = widget.getElement();
			widget.setParent(null);
			parentElement = pyjamas.ui.Panel.DOM.getParent(element);
			if (pyjslib.bool(parentElement)) {
				pyjamas.ui.Panel.DOM.removeChild(parentElement, element);
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.adopt = pyjs__bind_method(cls_instance, 'adopt', function(widget, container) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			container = arguments[2];
		}

		if (pyjslib.bool(container)) {
			widget.removeFromParent();
			pyjamas.ui.Panel.DOM.appendChild(container, widget.getElement());
		}
		widget.setParent(self);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'container']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

 		return null;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.doAttachChildren = pyjs__bind_method(cls_instance, 'doAttachChildren', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var child;
		var __child = self.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				child.onAttach();
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.doDetachChildren = pyjs__bind_method(cls_instance, 'doDetachChildren', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var child;
		var __child = self.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				child.onDetach();
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.children.__iter__();
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.Panel.Widget));
})();
return this;
}; /* end pyjamas.ui.Panel */
$pyjs.modules_hash['pyjamas.ui.Panel'] = $pyjs.loaded_modules['pyjamas.ui.Panel'];


 /* end module: pyjamas.ui.Panel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui', 'pyjamas.ui.Widget']
*/

/* start module: pyjamas.ui.Widget */
pyjamas.ui.Widget = $pyjs.loaded_modules["pyjamas.ui.Widget"] = function (__mod_name__) {
if(pyjamas.ui.Widget.__was_initialized__) return pyjamas.ui.Widget;
pyjamas.ui.Widget.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Widget';
var __name__ = pyjamas.ui.Widget.__name__ = __mod_name__;
var Widget = pyjamas.ui.Widget;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.Widget');
pyjamas.ui.Widget.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.log', 'pyjamas.ui.pyjamas', 'pyjamas.log', 'pyjamas'], 'pyjamas.log', 'pyjamas.ui.Widget');
pyjamas.ui.Widget.log = $pyjs.__modules__.pyjamas.log;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.UIObject.UIObject', 'pyjamas.ui.pyjamas.ui.UIObject', 'pyjamas.ui.UIObject.UIObject', 'pyjamas.ui.UIObject'], 'pyjamas.ui.UIObject.UIObject', 'pyjamas.ui.Widget');
pyjamas.ui.Widget.UIObject = $pyjs.__modules__.pyjamas.ui.UIObject.UIObject;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.Widget');
pyjamas.ui.Widget.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjamas.ui.Widget.Widget = (function(){
	var cls_instance = pyjs__class_instance('Widget');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'eb8a38383d6d19253d4ab38a9a4d2caf';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		self.attached = false;
		self.parent = null;
		self.layoutData = null;
		self.contextMenu = null;
		pyjs_kwargs_call(pyjamas.ui.Widget.UIObject, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.getLayoutData = pyjs__bind_method(cls_instance, 'getLayoutData', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.layoutData;
	}
	, 1, [null,null,'self']);
	cls_definition.getParent = pyjs__bind_method(cls_instance, 'getParent', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.parent;
	}
	, 1, [null,null,'self']);
	cls_definition.isAttached = pyjs__bind_method(cls_instance, 'isAttached', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.attached;
	}
	, 1, [null,null,'self']);
	cls_definition.setContextMenu = pyjs__bind_method(cls_instance, 'setContextMenu', function(menu) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			menu = arguments[1];
		}

		self.contextMenu = menu;
		if (pyjslib.bool(menu)) {
			self.sinkEvents(pyjamas.ui.Widget.Event.ONCONTEXTMENU);
		}
		else {
			self.unsinkEvents(pyjamas.ui.Widget.Event.ONCONTEXTMENU);
		}
		return null;
	}
	, 1, [null,null,'self', 'menu']);
	cls_definition.onBrowserEvent = pyjs__bind_method(cls_instance, 'onBrowserEvent', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var type;
		if (pyjslib.bool((self.contextMenu === null))) {
			return true;
		}
		type = pyjamas.ui.Widget.DOM.eventGetType(event);
		if (pyjslib.bool(pyjslib.eq(type, String('contextmenu')))) {
			pyjamas.ui.Widget.DOM.eventCancelBubble(event, true);
			pyjamas.ui.Widget.DOM.eventPreventDefault(event);
			self.contextMenu.onContextMenu(self);
			return false;
		}
		return true;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition.onLoad = pyjs__bind_method(cls_instance, 'onLoad', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

 		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.doDetachChildren = pyjs__bind_method(cls_instance, 'doDetachChildren', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

 		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.doAttachChildren = pyjs__bind_method(cls_instance, 'doAttachChildren', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

 		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.onAttach = pyjs__bind_method(cls_instance, 'onAttach', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool(self.isAttached())) {
			return null;
		}
		self.attached = true;
		pyjamas.ui.Widget.DOM.setEventListener(self.getElement(), self);
		self.doAttachChildren();
		self.onLoad();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.onDetach = pyjs__bind_method(cls_instance, 'onDetach', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool(!(self.isAttached()))) {
			return null;
		}
		self.doDetachChildren();
		self.attached = false;
		pyjamas.ui.Widget.DOM.setEventListener(self.getElement(), null);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.setLayoutData = pyjs__bind_method(cls_instance, 'setLayoutData', function(layoutData) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			layoutData = arguments[1];
		}

		self.layoutData = layoutData;
		return null;
	}
	, 1, [null,null,'self', 'layoutData']);
	cls_definition.setParent = pyjs__bind_method(cls_instance, 'setParent', function(parent) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			parent = arguments[1];
		}
		var oldparent;
		oldparent = self.parent;
		self.parent = parent;
		if (pyjslib.bool((parent === null))) {
			if (pyjslib.bool(((oldparent !== null)) && (oldparent.attached))) {
				self.onDetach();
			}
		}
		else if (pyjslib.bool(parent.attached)) {
			self.onAttach();
		}
		return null;
	}
	, 1, [null,null,'self', 'parent']);
	cls_definition.removeFromParent = pyjs__bind_method(cls_instance, 'removeFromParent', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool(pyjslib.hasattr(self.parent, String('remove')))) {
			self.parent.remove(self);
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.getID = pyjs__bind_method(cls_instance, 'getID', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.Widget.DOM.getAttribute(self.getElement(), String('id'));
	}
	, 1, [null,null,'self']);
	cls_definition.setID = pyjs__bind_method(cls_instance, 'setID', function(id) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			id = arguments[1];
		}

		pyjamas.ui.Widget.DOM.setAttribute(self.getElement(), String('id'), id);
		return null;
	}
	, 1, [null,null,'self', 'id']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.Widget.UIObject));
})();
return this;
}; /* end pyjamas.ui.Widget */
$pyjs.modules_hash['pyjamas.ui.Widget'] = $pyjs.loaded_modules['pyjamas.ui.Widget'];


 /* end module: pyjamas.ui.Widget */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.log', 'pyjamas.ui.UIObject.UIObject', 'pyjamas.ui', 'pyjamas.ui.UIObject', 'pyjamas.ui.Event']
*/

/* start module: pyjamas.log */
pyjamas.log = $pyjs.loaded_modules["pyjamas.log"] = function (__mod_name__) {
if(pyjamas.log.__was_initialized__) return pyjamas.log;
pyjamas.log.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.log';
var __name__ = pyjamas.log.__name__ = __mod_name__;
var log = pyjamas.log;

pyjslib.__import__(['pyjamas.pyjamas.DOM', 'pyjamas.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.log');
pyjamas.log.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjamas.log.getBodyElement = function() {

	return $doc.body;
};
pyjamas.log.getBodyElement.__name__ = 'getBodyElement';

pyjamas.log.getBodyElement.__bind_type__ = 0;
pyjamas.log.getBodyElement.__args__ = [null,null];
pyjamas.log.write = function(text) {

	pyjamas.log.add_elem();
	text = text.replace(String('\x0A'), String('\x3Cbr /\x3E\x0A'));
	pyjamas.log.data += text;
	pyjamas.log.DOM.setInnerHTML(pyjamas.log.element, pyjamas.log.data);
	return null;
};
pyjamas.log.write.__name__ = 'write';

pyjamas.log.write.__bind_type__ = 0;
pyjamas.log.write.__args__ = [null,null,'text'];
pyjamas.log.writebr = function(text) {

	pyjamas.log.write( ( text + String('\x0A') ) );
	return null;
};
pyjamas.log.writebr.__name__ = 'writebr';

pyjamas.log.writebr.__bind_type__ = 0;
pyjamas.log.writebr.__args__ = [null,null,'text'];
pyjamas.log.data = String('');
pyjamas.log.element = null;
pyjamas.log.add_elem = function() {

	if (pyjslib.bool((pyjamas.log.element !== null))) {
		return null;
	}
	pyjamas.log.element = pyjamas.log.DOM.createDiv();
	pyjamas.log.DOM.appendChild(pyjamas.log.getBodyElement(), pyjamas.log.element);
	return null;
};
pyjamas.log.add_elem.__name__ = 'add_elem';

pyjamas.log.add_elem.__bind_type__ = 0;
pyjamas.log.add_elem.__args__ = [null,null];
return this;
}; /* end pyjamas.log */
$pyjs.modules_hash['pyjamas.log'] = $pyjs.loaded_modules['pyjamas.log'];


 /* end module: pyjamas.log */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas']
*/

/* start module: pyjamas.ui.UIObject */
pyjamas.ui.UIObject = $pyjs.loaded_modules["pyjamas.ui.UIObject"] = function (__mod_name__) {
if(pyjamas.ui.UIObject.__was_initialized__) return pyjamas.ui.UIObject;
pyjamas.ui.UIObject.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.UIObject';
var __name__ = pyjamas.ui.UIObject.__name__ = __mod_name__;
var UIObject = pyjamas.ui.UIObject;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.UIObject');
pyjamas.ui.UIObject.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.Window', 'pyjamas.ui.pyjamas', 'pyjamas.Window', 'pyjamas'], 'pyjamas.Window', 'pyjamas.ui.UIObject');
pyjamas.ui.UIObject.Window = $pyjs.__modules__.pyjamas.Window;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Applier', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Applier', 'pyjamas.ui'], 'pyjamas.ui.Applier', 'pyjamas.ui.UIObject');
pyjamas.ui.UIObject.Applier = $pyjs.__modules__.pyjamas.ui.Applier;
pyjamas.ui.UIObject.setStyleName = function(element, style, add) {
	var last,idx,lastPos,oldStyle,begin,end;
	oldStyle = pyjamas.ui.UIObject.DOM.getAttribute(element, String('className'));
	if (pyjslib.bool((oldStyle === null))) {
		oldStyle = String('');
	}
	idx = oldStyle.find(style);
	lastPos = pyjslib.len(oldStyle);
    while (pyjslib.bool(!pyjslib.eq(idx, -1))) {
	if (pyjslib.bool((pyjslib.eq(idx, 0)) || (pyjslib.eq(oldStyle.__getitem__( ( idx - 1 ) ), String(' '))))) {
		last =  ( idx + pyjslib.len(style) ) ;
		if (pyjslib.bool((pyjslib.eq(last, lastPos)) || (((pyjslib.cmp(last, lastPos) == -1)) && (pyjslib.eq(oldStyle.__getitem__(last), String(' ')))))) {
			break;
		}
	}
	idx = oldStyle.find(style,  ( idx + 1 ) );
    }
	if (pyjslib.bool(add)) {
		if (pyjslib.bool(pyjslib.eq(idx, -1))) {
			pyjamas.ui.UIObject.DOM.setAttribute(element, String('className'),  (  ( oldStyle + String(' ') )  + style ) );
		}
	}
	else {
		if (pyjslib.bool(!pyjslib.eq(idx, -1))) {
			begin = pyjslib.slice(oldStyle, null,  ( idx - 1 ) );
			end = pyjslib.slice(oldStyle,  ( idx + pyjslib.len(style) ) , null);
			pyjamas.ui.UIObject.DOM.setAttribute(element, String('className'),  ( begin + end ) );
		}
	}
	return null;
};
pyjamas.ui.UIObject.setStyleName.__name__ = 'setStyleName';

pyjamas.ui.UIObject.setStyleName.__bind_type__ = 0;
pyjamas.ui.UIObject.setStyleName.__args__ = [null,null,'element', 'style', 'add'];
pyjamas.ui.UIObject.UIObject = (function(){
	var cls_instance = pyjs__class_instance('UIObject');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'b8c96dc4384c32fcdb1c0326528e800f';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		pyjs_kwargs_call(pyjamas.ui.UIObject.Applier, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.getAbsoluteLeft = pyjs__bind_method(cls_instance, 'getAbsoluteLeft', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.UIObject.DOM.getAbsoluteLeft(self.getElement());
	}
	, 1, [null,null,'self']);
	cls_definition.getAbsoluteTop = pyjs__bind_method(cls_instance, 'getAbsoluteTop', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.UIObject.DOM.getAbsoluteTop(self.getElement());
	}
	, 1, [null,null,'self']);
	cls_definition.getElement = pyjs__bind_method(cls_instance, 'getElement', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.element;
	}
	, 1, [null,null,'self']);
	cls_definition.getOffsetHeight = pyjs__bind_method(cls_instance, 'getOffsetHeight', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.UIObject.DOM.getIntAttribute(self.element, String('offsetHeight'));
	}
	, 1, [null,null,'self']);
	cls_definition.getOffsetWidth = pyjs__bind_method(cls_instance, 'getOffsetWidth', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.UIObject.DOM.getIntAttribute(self.element, String('offsetWidth'));
	}
	, 1, [null,null,'self']);
	cls_definition.getStyleName = pyjs__bind_method(cls_instance, 'getStyleName', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.UIObject.DOM.getAttribute(self.element, String('className'));
	}
	, 1, [null,null,'self']);
	cls_definition.getStylePrimaryName = pyjs__bind_method(cls_instance, 'getStylePrimaryName', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var fullClassName;
		fullClassName = self.getStyleName();
		if (pyjslib.bool(fullClassName)) {
			return fullClassName.split().__getitem__(0);
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.getTitle = pyjs__bind_method(cls_instance, 'getTitle', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.UIObject.DOM.getAttribute(self.element, String('title'));
	}
	, 1, [null,null,'self']);
	cls_definition.setElement = pyjs__bind_method(cls_instance, 'setElement', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
		}

		self.element = element;
		return null;
	}
	, 1, [null,null,'self', 'element']);
	cls_definition.setHeight = pyjs__bind_method(cls_instance, 'setHeight', function(height) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			height = arguments[1];
		}

		pyjamas.ui.UIObject.DOM.setStyleAttribute(self.element, String('height'), pyjslib.str(height));
		return null;
	}
	, 1, [null,null,'self', 'height']);
	cls_definition.getHeight = pyjs__bind_method(cls_instance, 'getHeight', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.UIObject.DOM.getStyleAttribute(self.element, String('height'));
	}
	, 1, [null,null,'self']);
	cls_definition.setPixelSize = pyjs__bind_method(cls_instance, 'setPixelSize', function(width, height) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			width = arguments[1];
			height = arguments[2];
		}

		if (pyjslib.bool((pyjslib.cmp(width, 0) != -1))) {
			self.setWidth(pyjslib.sprintf(String('%dpx'), width));
		}
		if (pyjslib.bool((pyjslib.cmp(height, 0) != -1))) {
			self.setHeight(pyjslib.sprintf(String('%dpx'), height));
		}
		return null;
	}
	, 1, [null,null,'self', 'width', 'height']);
	cls_definition.setSize = pyjs__bind_method(cls_instance, 'setSize', function(width, height) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			width = arguments[1];
			height = arguments[2];
		}

		self.setWidth(width);
		self.setHeight(height);
		return null;
	}
	, 1, [null,null,'self', 'width', 'height']);
	cls_definition.addStyleName = pyjs__bind_method(cls_instance, 'addStyleName', function(style) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			style = arguments[1];
		}

		self.setStyleName(self.element, style, true);
		return null;
	}
	, 1, [null,null,'self', 'style']);
	cls_definition.addStyleDependentName = pyjs__bind_method(cls_instance, 'addStyleDependentName', function(styleSuffix) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			styleSuffix = arguments[1];
		}

		self.addStyleName( (  ( self.getStylePrimaryName() + String('-') )  + styleSuffix ) );
		return null;
	}
	, 1, [null,null,'self', 'styleSuffix']);
	cls_definition.removeStyleName = pyjs__bind_method(cls_instance, 'removeStyleName', function(style) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			style = arguments[1];
		}

		self.setStyleName(self.element, style, false);
		return null;
	}
	, 1, [null,null,'self', 'style']);
	cls_definition.removeStyleDependentName = pyjs__bind_method(cls_instance, 'removeStyleDependentName', function(styleSuffix) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			styleSuffix = arguments[1];
		}

		self.removeStyleName( (  ( self.getStylePrimaryName() + String('-') )  + styleSuffix ) );
		return null;
	}
	, 1, [null,null,'self', 'styleSuffix']);
	cls_definition.setStyleName = pyjs__bind_method(cls_instance, 'setStyleName', function(element, style, add) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
			style = arguments[2];
			add = arguments[3];
		}
		if (typeof style == 'undefined') style=null;
		if (typeof add == 'undefined') add=true;

		if (pyjslib.bool((style === null))) {
			style = element;
			pyjamas.ui.UIObject.DOM.setAttribute(self.element, String('className'), style);
			return null;
		}
		pyjamas.ui.UIObject.setStyleName(element, style, add);
		return null;
	}
	, 1, [null,null,'self', 'element', 'style', 'add']);
	cls_definition.setTitle = pyjs__bind_method(cls_instance, 'setTitle', function(title) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			title = arguments[1];
		}

		pyjamas.ui.UIObject.DOM.setAttribute(self.element, String('title'), title);
		return null;
	}
	, 1, [null,null,'self', 'title']);
	cls_definition.setWidth = pyjs__bind_method(cls_instance, 'setWidth', function(width) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			width = arguments[1];
		}

		pyjamas.ui.UIObject.DOM.setStyleAttribute(self.element, String('width'), pyjslib.str(width));
		return null;
	}
	, 1, [null,null,'self', 'width']);
	cls_definition.getWidth = pyjs__bind_method(cls_instance, 'getWidth', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.UIObject.DOM.getStyleAttribute(self.element, String('width'));
	}
	, 1, [null,null,'self']);
	cls_definition.sinkEvents = pyjs__bind_method(cls_instance, 'sinkEvents', function(eventBitsToAdd) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			eventBitsToAdd = arguments[1];
		}

		if (pyjslib.bool(self.element)) {
			pyjamas.ui.UIObject.DOM.sinkEvents(self.getElement(), ((eventBitsToAdd | pyjamas.ui.UIObject.DOM.getEventsSunk(self.getElement()))));
		}
		return null;
	}
	, 1, [null,null,'self', 'eventBitsToAdd']);
	cls_definition.setzIndex = pyjs__bind_method(cls_instance, 'setzIndex', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		pyjamas.ui.UIObject.DOM.setIntStyleAttribute(self.element, String('zIndex'), index);
		return null;
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.isVisible = pyjs__bind_method(cls_instance, 'isVisible', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
		}
		if (typeof element == 'undefined') element=null;
		var err,pyjs_try_err;
		if (pyjslib.bool(!(element))) {
			element = self.element;
		}
		try {
			return !pyjslib.eq(element.style.display, String('none'));
		} catch(pyjs_try_err) {
			var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
			$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjamas.ui.UIObject, try_lineno: 166};
			if (pyjs_try_err_name == pyjslib.AttributeError.__name__) {
				$pyjs.__last_exception__.except_lineno = 168;
				err = pyjs_try_err;
				return true;
			} else { throw pyjs_try_err; }
		}
		return null;
	}
	, 1, [null,null,'self', 'element']);
	cls_definition.setVisible = pyjs__bind_method(cls_instance, 'setVisible', function(element, visible) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
			visible = arguments[2];
		}
		if (typeof visible == 'undefined') visible=null;

		if (pyjslib.bool((visible === null))) {
			visible = element;
			element = self.element;
		}
		if (pyjslib.bool(visible)) {
			pyjamas.ui.UIObject.DOM.setStyleAttribute(element, String('display'), String(''));
		}
		else {
			pyjamas.ui.UIObject.DOM.setStyleAttribute(element, String('display'), String('none'));
		}
		return null;
	}
	, 1, [null,null,'self', 'element', 'visible']);
	cls_definition.unsinkEvents = pyjs__bind_method(cls_instance, 'unsinkEvents', function(eventBitsToRemove) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			eventBitsToRemove = arguments[1];
		}

		pyjamas.ui.UIObject.DOM.sinkEvents(self.getElement(), (((~eventBitsToRemove) & pyjamas.ui.UIObject.DOM.getEventsSunk(self.getElement()))));
		return null;
	}
	, 1, [null,null,'self', 'eventBitsToRemove']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.UIObject.Applier));
})();
return this;
}; /* end pyjamas.ui.UIObject */
$pyjs.modules_hash['pyjamas.ui.UIObject'] = $pyjs.loaded_modules['pyjamas.ui.UIObject'];


 /* end module: pyjamas.ui.UIObject */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.Window', 'pyjamas.ui.Applier', 'pyjamas.ui']
*/

/* start module: pyjamas.ui.Event */
pyjamas.ui.Event = $pyjs.loaded_modules["pyjamas.ui.Event"] = function (__mod_name__) {
if(pyjamas.ui.Event.__was_initialized__) return pyjamas.ui.Event;
pyjamas.ui.Event.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Event';
var __name__ = pyjamas.ui.Event.__name__ = __mod_name__;
var Event = pyjamas.ui.Event;

pyjamas.ui.Event.BUTTON_LEFT = 0;
pyjamas.ui.Event.BUTTON_MIDDLE = 1;
pyjamas.ui.Event.BUTTON_RIGHT = 2;
pyjamas.ui.Event.ONBLUR = 4096;
pyjamas.ui.Event.ONCHANGE = 1024;
pyjamas.ui.Event.ONCLICK = 1;
pyjamas.ui.Event.ONCONTEXTMENU = 131072;
pyjamas.ui.Event.ONDBLCLICK = 2;
pyjamas.ui.Event.ONERROR = 65536;
pyjamas.ui.Event.ONFOCUS = 2048;
pyjamas.ui.Event.ONKEYDOWN = 128;
pyjamas.ui.Event.ONKEYPRESS = 256;
pyjamas.ui.Event.ONKEYUP = 512;
pyjamas.ui.Event.ONLOAD = 32768;
pyjamas.ui.Event.ONLOSECAPTURE = 8192;
pyjamas.ui.Event.ONMOUSEDOWN = 4;
pyjamas.ui.Event.ONMOUSEMOVE = 64;
pyjamas.ui.Event.ONMOUSEOUT = 32;
pyjamas.ui.Event.ONMOUSEOVER = 16;
pyjamas.ui.Event.ONMOUSEUP = 8;
pyjamas.ui.Event.ONSCROLL = 16384;
pyjamas.ui.Event.FOCUSEVENTS = 6144;
pyjamas.ui.Event.KEYEVENTS = 896;
pyjamas.ui.Event.MOUSEEVENTS = 124;
return this;
}; /* end pyjamas.ui.Event */
$pyjs.modules_hash['pyjamas.ui.Event'] = $pyjs.loaded_modules['pyjamas.ui.Event'];


 /* end module: pyjamas.ui.Event */



/* start module: pyjamas.ui.TabPanel */
pyjamas.ui.TabPanel = $pyjs.loaded_modules["pyjamas.ui.TabPanel"] = function (__mod_name__) {
if(pyjamas.ui.TabPanel.__was_initialized__) return pyjamas.ui.TabPanel;
pyjamas.ui.TabPanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.TabPanel';
var __name__ = pyjamas.ui.TabPanel.__name__ = __mod_name__;
var TabPanel = pyjamas.ui.TabPanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.TabPanel');
pyjamas.ui.TabPanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Composite.Composite', 'pyjamas.ui.pyjamas.ui.Composite', 'pyjamas.ui.Composite.Composite', 'pyjamas.ui.Composite'], 'pyjamas.ui.Composite.Composite', 'pyjamas.ui.TabPanel');
pyjamas.ui.TabPanel.Composite = $pyjs.__modules__.pyjamas.ui.Composite.Composite;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.DeckPanel.DeckPanel', 'pyjamas.ui.pyjamas.ui.DeckPanel', 'pyjamas.ui.DeckPanel.DeckPanel', 'pyjamas.ui.DeckPanel'], 'pyjamas.ui.DeckPanel.DeckPanel', 'pyjamas.ui.TabPanel');
pyjamas.ui.TabPanel.DeckPanel = $pyjs.__modules__.pyjamas.ui.DeckPanel.DeckPanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.VerticalPanel.VerticalPanel', 'pyjamas.ui.pyjamas.ui.VerticalPanel', 'pyjamas.ui.VerticalPanel.VerticalPanel', 'pyjamas.ui.VerticalPanel'], 'pyjamas.ui.VerticalPanel.VerticalPanel', 'pyjamas.ui.TabPanel');
pyjamas.ui.TabPanel.VerticalPanel = $pyjs.__modules__.pyjamas.ui.VerticalPanel.VerticalPanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.TabBar.TabBar', 'pyjamas.ui.pyjamas.ui.TabBar', 'pyjamas.ui.TabBar.TabBar', 'pyjamas.ui.TabBar'], 'pyjamas.ui.TabBar.TabBar', 'pyjamas.ui.TabPanel');
pyjamas.ui.TabPanel.TabBar = $pyjs.__modules__.pyjamas.ui.TabBar.TabBar;
pyjamas.ui.TabPanel.TabPanel = (function(){
	var cls_instance = pyjs__class_instance('TabPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'fee6f11126277c311c80f4f6d5ad4b7d';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(tabBar) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			tabBar = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof tabBar != 'undefined') {
				if (pyjslib.get_pyjs_classtype(tabBar) == 'Dict') {
					kwargs = tabBar;
					tabBar = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}
		if (typeof tabBar == 'undefined') tabBar=null;
		var panel;
		self.tab_children = new pyjslib.List([]);
		self.deck = pyjs_kwargs_call(pyjamas.ui.TabPanel, 'DeckPanel', null, null, [{StyleName:String('gwt-TabPanelBottom')}]);
		if (pyjslib.bool((tabBar === null))) {
			self.tabBar = pyjamas.ui.TabPanel.TabBar();
		}
		else {
			self.tabBar = tabBar;
		}
		self.tabListeners = new pyjslib.List([]);
		panel = pyjamas.ui.TabPanel.VerticalPanel();
		panel.add(self.tabBar);
		panel.add(self.deck);
		panel.setCellHeight(self.deck, String('100%'));
		self.tabBar.setWidth(String('100%'));
		self.tabBar.addTabListener(self);
		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), String('gwt-TabPanel'));
		}
		pyjs_kwargs_call(pyjamas.ui.TabPanel.Composite, '__init__', null, kwargs, [{}, self, panel]);
		return null;
	}
	, 1, [null,'kwargs','self', 'tabBar']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(widget, tabText, asHTML) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			tabText = arguments[2];
			asHTML = arguments[3];
		}
		if (typeof tabText == 'undefined') tabText=null;
		if (typeof asHTML == 'undefined') asHTML=false;

		if (pyjslib.bool((tabText === null))) {
			console.error(String('A tabText parameter must be specified with add().'));
		}
		self.insert(widget, tabText, asHTML, self.getWidgetCount());
		return null;
	}
	, 1, [null,null,'self', 'widget', 'tabText', 'asHTML']);
	cls_definition.addTabListener = pyjs__bind_method(cls_instance, 'addTabListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.tabListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.clear = pyjs__bind_method(cls_instance, 'clear', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

    while (pyjslib.bool((pyjslib.cmp(self.getWidgetCount(), 0) == 1))) {
		self.remove(self.getWidget(0));
    }
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.getDeckPanel = pyjs__bind_method(cls_instance, 'getDeckPanel', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.deck;
	}
	, 1, [null,null,'self']);
	cls_definition.getTabBar = pyjs__bind_method(cls_instance, 'getTabBar', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.tabBar;
	}
	, 1, [null,null,'self']);
	cls_definition.getWidget = pyjs__bind_method(cls_instance, 'getWidget', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		return self.tab_children.__getitem__(index);
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.getWidgetCount = pyjs__bind_method(cls_instance, 'getWidgetCount', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjslib.len(self.tab_children);
	}
	, 1, [null,null,'self']);
	cls_definition.getWidgetIndex = pyjs__bind_method(cls_instance, 'getWidgetIndex', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		return self.tab_children.index(child);
	}
	, 1, [null,null,'self', 'child']);
	cls_definition.insert = pyjs__bind_method(cls_instance, 'insert', function(widget, tabText, asHTML, beforeIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			tabText = arguments[2];
			asHTML = arguments[3];
			beforeIndex = arguments[4];
		}
		if (typeof asHTML == 'undefined') asHTML=false;
		if (typeof beforeIndex == 'undefined') beforeIndex=null;

		if (pyjslib.bool((beforeIndex === null))) {
			beforeIndex = asHTML;
			asHTML = false;
		}
		self.tab_children.insert(beforeIndex, widget);
		self.tabBar.insertTab(tabText, asHTML, beforeIndex);
		self.deck.insert(widget, beforeIndex);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'tabText', 'asHTML', 'beforeIndex']);
	cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.tab_children.__iter__();
	}
	, 1, [null,null,'self']);
	cls_definition.onBeforeTabSelected = pyjs__bind_method(cls_instance, 'onBeforeTabSelected', function(sender, tabIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			sender = arguments[1];
			tabIndex = arguments[2];
		}
		var listener;
		var __listener = self.tabListeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				if (pyjslib.bool(!(listener.onBeforeTabSelected(sender, tabIndex)))) {
					return false;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return true;
	}
	, 1, [null,null,'self', 'sender', 'tabIndex']);
	cls_definition.onTabSelected = pyjs__bind_method(cls_instance, 'onTabSelected', function(sender, tabIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			sender = arguments[1];
			tabIndex = arguments[2];
		}
		var listener;
		self.deck.showWidget(tabIndex);
		var __listener = self.tabListeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onTabSelected(sender, tabIndex);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'sender', 'tabIndex']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}
		var index;
		if (pyjslib.bool(pyjslib.isinstance(widget, pyjslib.int_))) {
			widget = self.getWidget(widget);
		}
		index = self.getWidgetIndex(widget);
		if (pyjslib.bool(pyjslib.eq(index, -1))) {
			return false;
		}
		self.tab_children.remove(widget);
		self.tabBar.removeTab(index);
		self.deck.remove(widget);
		return true;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.removeTabListener = pyjs__bind_method(cls_instance, 'removeTabListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.tabListeners.remove(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.selectTab = pyjs__bind_method(cls_instance, 'selectTab', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		self.tabBar.selectTab(index);
		return null;
	}
	, 1, [null,null,'self', 'index']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.TabPanel.Composite));
})();
return this;
}; /* end pyjamas.ui.TabPanel */
$pyjs.modules_hash['pyjamas.ui.TabPanel'] = $pyjs.loaded_modules['pyjamas.ui.TabPanel'];


 /* end module: pyjamas.ui.TabPanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Composite.Composite', 'pyjamas.ui', 'pyjamas.ui.Composite', 'pyjamas.ui.DeckPanel.DeckPanel', 'pyjamas.ui.DeckPanel', 'pyjamas.ui.VerticalPanel.VerticalPanel', 'pyjamas.ui.VerticalPanel', 'pyjamas.ui.TabBar.TabBar', 'pyjamas.ui.TabBar']
*/

/* start module: pyjamas.ui.Composite */
pyjamas.ui.Composite = $pyjs.loaded_modules["pyjamas.ui.Composite"] = function (__mod_name__) {
if(pyjamas.ui.Composite.__was_initialized__) return pyjamas.ui.Composite;
pyjamas.ui.Composite.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Composite';
var __name__ = pyjamas.ui.Composite.__name__ = __mod_name__;
var Composite = pyjamas.ui.Composite;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.Composite');
pyjamas.ui.Composite.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Widget.Widget', 'pyjamas.ui.pyjamas.ui.Widget', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Widget'], 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Composite');
pyjamas.ui.Composite.Widget = $pyjs.__modules__.pyjamas.ui.Widget.Widget;
pyjamas.ui.Composite.Composite = (function(){
	var cls_instance = pyjs__class_instance('Composite');
	var cls_definition = new Object();
	cls_definition.__md5__ = '96ee54547f229c058c438b8dfaf0ff10';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			widget = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof widget != 'undefined') {
				if (pyjslib.get_pyjs_classtype(widget) == 'Dict') {
					kwargs = widget;
					widget = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}
		if (typeof widget == 'undefined') widget=null;

		self.widget = null;
		self.attached = null;
		if (pyjslib.bool(widget)) {
			self.initWidget(widget);
		}
		pyjs_kwargs_call(pyjamas.ui.Composite.Widget, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self', 'widget']);
	cls_definition.initWidget = pyjs__bind_method(cls_instance, 'initWidget', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool((self.widget !== null))) {
			return null;
		}
		widget.removeFromParent();
		self.setElement(widget.getElement());
		self.widget = widget;
		widget.setParent(self);
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.isAttached = pyjs__bind_method(cls_instance, 'isAttached', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool(self.widget)) {
			return self.widget.isAttached();
		}
		return false;
	}
	, 1, [null,null,'self']);
	cls_definition.onAttach = pyjs__bind_method(cls_instance, 'onAttach', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.widget.onAttach();
		pyjamas.ui.Composite.DOM.setEventListener(self.getElement(), self);
		self.onLoad();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.onDetach = pyjs__bind_method(cls_instance, 'onDetach', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.widget.onDetach();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.setWidget = pyjs__bind_method(cls_instance, 'setWidget', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		self.initWidget(widget);
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.onBrowserEvent = pyjs__bind_method(cls_instance, 'onBrowserEvent', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}

		self.widget.onBrowserEvent(event);
		return null;
	}
	, 1, [null,null,'self', 'event']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.Composite.Widget));
})();
return this;
}; /* end pyjamas.ui.Composite */
$pyjs.modules_hash['pyjamas.ui.Composite'] = $pyjs.loaded_modules['pyjamas.ui.Composite'];


 /* end module: pyjamas.ui.Composite */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui', 'pyjamas.ui.Widget']
*/

/* start module: pyjamas.ui.DeckPanel */
pyjamas.ui.DeckPanel = $pyjs.loaded_modules["pyjamas.ui.DeckPanel"] = function (__mod_name__) {
if(pyjamas.ui.DeckPanel.__was_initialized__) return pyjamas.ui.DeckPanel;
pyjamas.ui.DeckPanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.DeckPanel';
var __name__ = pyjamas.ui.DeckPanel.__name__ = __mod_name__;
var DeckPanel = pyjamas.ui.DeckPanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.DeckPanel');
pyjamas.ui.DeckPanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.pyjamas.ui.ComplexPanel', 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.ComplexPanel'], 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.DeckPanel');
pyjamas.ui.DeckPanel.ComplexPanel = $pyjs.__modules__.pyjamas.ui.ComplexPanel.ComplexPanel;
pyjamas.ui.DeckPanel.DeckPanel = (function(){
	var cls_instance = pyjs__class_instance('DeckPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = '9aa5648995ce86e63d8a427deb806210';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		self.visibleWidget = null;
		self.setElement(pyjamas.ui.DeckPanel.DOM.createDiv());
		pyjs_kwargs_call(pyjamas.ui.DeckPanel.ComplexPanel, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		self.insert(widget, self.getWidgetCount());
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.getVisibleWidget = pyjs__bind_method(cls_instance, 'getVisibleWidget', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.getWidgetIndex(self.visibleWidget);
	}
	, 1, [null,null,'self']);
	cls_definition.getWidget = pyjs__bind_method(cls_instance, 'getWidget', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		return self.children.__getitem__(index);
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.getWidgetCount = pyjs__bind_method(cls_instance, 'getWidgetCount', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjslib.len(self.children);
	}
	, 1, [null,null,'self']);
	cls_definition.getWidgetIndex = pyjs__bind_method(cls_instance, 'getWidgetIndex', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		return self.children.index(child);
	}
	, 1, [null,null,'self', 'child']);
	cls_definition.insert = pyjs__bind_method(cls_instance, 'insert', function(widget, beforeIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			beforeIndex = arguments[2];
		}
		if (typeof beforeIndex == 'undefined') beforeIndex=null;
		var child;
		if (pyjslib.bool(((pyjslib.cmp(beforeIndex, 0) == -1)) || ((pyjslib.cmp(beforeIndex, self.getWidgetCount()) == 1)))) {
			return null;
		}
		pyjamas.ui.DeckPanel.ComplexPanel.insert(self, widget, self.getElement(), beforeIndex);
		child = widget.getElement();
		pyjamas.ui.DeckPanel.DOM.setStyleAttribute(child, String('width'), String('100%'));
		pyjamas.ui.DeckPanel.DOM.setStyleAttribute(child, String('height'), String('100%'));
		widget.setVisible(false);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'beforeIndex']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool(pyjslib.isinstance(widget, pyjslib.int_))) {
			widget = self.getWidget(widget);
		}
		if (pyjslib.bool(!(pyjamas.ui.DeckPanel.ComplexPanel.remove(self, widget)))) {
			return false;
		}
		if (pyjslib.bool(pyjslib.eq(self.visibleWidget, widget))) {
			self.visibleWidget = null;
		}
		return true;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.showWidget = pyjs__bind_method(cls_instance, 'showWidget', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		self.checkIndex(index);
		if (pyjslib.bool((self.visibleWidget !== null))) {
			self.visibleWidget.setVisible(false);
		}
		self.visibleWidget = self.getWidget(index);
		self.visibleWidget.setVisible(true);
		return null;
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.checkIndex = pyjs__bind_method(cls_instance, 'checkIndex', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		if (pyjslib.bool(((pyjslib.cmp(index, 0) == -1)) || ((pyjslib.cmp(index, self.getWidgetCount()) != -1)))) {
		}
		return null;
	}
	, 1, [null,null,'self', 'index']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.DeckPanel.ComplexPanel));
})();
return this;
}; /* end pyjamas.ui.DeckPanel */
$pyjs.modules_hash['pyjamas.ui.DeckPanel'] = $pyjs.loaded_modules['pyjamas.ui.DeckPanel'];


 /* end module: pyjamas.ui.DeckPanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui', 'pyjamas.ui.ComplexPanel']
*/

/* start module: pyjamas.ui.ComplexPanel */
pyjamas.ui.ComplexPanel = $pyjs.loaded_modules["pyjamas.ui.ComplexPanel"] = function (__mod_name__) {
if(pyjamas.ui.ComplexPanel.__was_initialized__) return pyjamas.ui.ComplexPanel;
pyjamas.ui.ComplexPanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.ComplexPanel';
var __name__ = pyjamas.ui.ComplexPanel.__name__ = __mod_name__;
var ComplexPanel = pyjamas.ui.ComplexPanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.ComplexPanel');
pyjamas.ui.ComplexPanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Panel.Panel', 'pyjamas.ui.pyjamas.ui.Panel', 'pyjamas.ui.Panel.Panel', 'pyjamas.ui.Panel'], 'pyjamas.ui.Panel.Panel', 'pyjamas.ui.ComplexPanel');
pyjamas.ui.ComplexPanel.Panel = $pyjs.__modules__.pyjamas.ui.Panel.Panel;
pyjamas.ui.ComplexPanel.ComplexPanel = (function(){
	var cls_instance = pyjs__class_instance('ComplexPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = '5674f5e05ca2413cc88afc22b7edefc9';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		pyjs_kwargs_call(pyjamas.ui.ComplexPanel.Panel, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(widget, container) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			container = arguments[2];
		}

		self.insert(widget, container, pyjslib.len(self.children));
		return null;
	}
	, 1, [null,null,'self', 'widget', 'container']);
	cls_definition.getChildren = pyjs__bind_method(cls_instance, 'getChildren', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.children;
	}
	, 1, [null,null,'self']);
	cls_definition.insert = pyjs__bind_method(cls_instance, 'insert', function(widget, container, beforeIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			container = arguments[2];
			beforeIndex = arguments[3];
		}

		if (pyjslib.bool(pyjslib.eq(widget.getParent(), self))) {
			return null;
		}
		self.adopt(widget, container);
		self.children.insert(beforeIndex, widget);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'container', 'beforeIndex']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool(!self.children.__contains__(widget))) {
			return false;
		}
		self.disown(widget);
		self.children.remove(widget);
		return true;
	}
	, 1, [null,null,'self', 'widget']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.ComplexPanel.Panel));
})();
return this;
}; /* end pyjamas.ui.ComplexPanel */
$pyjs.modules_hash['pyjamas.ui.ComplexPanel'] = $pyjs.loaded_modules['pyjamas.ui.ComplexPanel'];


 /* end module: pyjamas.ui.ComplexPanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Panel.Panel', 'pyjamas.ui', 'pyjamas.ui.Panel']
*/

/* start module: pyjamas.ui.VerticalPanel */
pyjamas.ui.VerticalPanel = $pyjs.loaded_modules["pyjamas.ui.VerticalPanel"] = function (__mod_name__) {
if(pyjamas.ui.VerticalPanel.__was_initialized__) return pyjamas.ui.VerticalPanel;
pyjamas.ui.VerticalPanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.VerticalPanel';
var __name__ = pyjamas.ui.VerticalPanel.__name__ = __mod_name__;
var VerticalPanel = pyjamas.ui.VerticalPanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.VerticalPanel');
pyjamas.ui.VerticalPanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.CellPanel.CellPanel', 'pyjamas.ui.pyjamas.ui.CellPanel', 'pyjamas.ui.CellPanel.CellPanel', 'pyjamas.ui.CellPanel'], 'pyjamas.ui.CellPanel.CellPanel', 'pyjamas.ui.VerticalPanel');
pyjamas.ui.VerticalPanel.CellPanel = $pyjs.__modules__.pyjamas.ui.CellPanel.CellPanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.HasHorizontalAlignment', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.HasHorizontalAlignment', 'pyjamas.ui'], 'pyjamas.ui.HasHorizontalAlignment', 'pyjamas.ui.VerticalPanel');
pyjamas.ui.VerticalPanel.HasHorizontalAlignment = $pyjs.__modules__.pyjamas.ui.HasHorizontalAlignment;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.HasVerticalAlignment', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.HasVerticalAlignment', 'pyjamas.ui'], 'pyjamas.ui.HasVerticalAlignment', 'pyjamas.ui.VerticalPanel');
pyjamas.ui.VerticalPanel.HasVerticalAlignment = $pyjs.__modules__.pyjamas.ui.HasVerticalAlignment;
pyjamas.ui.VerticalPanel.VerticalPanel = (function(){
	var cls_instance = pyjs__class_instance('VerticalPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = '334b45491289015b8fb7e6046aec14b2';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		if (pyjslib.bool(!(kwargs.has_key(String('Spacing'))))) {
			kwargs.__setitem__(String('Spacing'), 0);
		}
		if (pyjslib.bool(!(kwargs.has_key(String('Padding'))))) {
			kwargs.__setitem__(String('Padding'), 0);
		}
		self.horzAlign = pyjamas.ui.VerticalPanel.HasHorizontalAlignment.ALIGN_LEFT;
		self.vertAlign = pyjamas.ui.VerticalPanel.HasVerticalAlignment.ALIGN_TOP;
		pyjs_kwargs_call(pyjamas.ui.VerticalPanel.CellPanel, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		self.insert(widget, self.getWidgetCount());
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.getHorizontalAlignment = pyjs__bind_method(cls_instance, 'getHorizontalAlignment', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.horzAlign;
	}
	, 1, [null,null,'self']);
	cls_definition.getVerticalAlignment = pyjs__bind_method(cls_instance, 'getVerticalAlignment', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.vertAlign;
	}
	, 1, [null,null,'self']);
	cls_definition.getWidget = pyjs__bind_method(cls_instance, 'getWidget', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		return self.children.__getitem__(index);
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.getWidgetCount = pyjs__bind_method(cls_instance, 'getWidgetCount', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjslib.len(self.children);
	}
	, 1, [null,null,'self']);
	cls_definition.getWidgetIndex = pyjs__bind_method(cls_instance, 'getWidgetIndex', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		return self.children.index(child);
	}
	, 1, [null,null,'self', 'child']);
	cls_definition.setWidget = pyjs__bind_method(cls_instance, 'setWidget', function(index, widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
			widget = arguments[2];
		}
		var existing;
		existing = self.getWidget(index);
		if (pyjslib.bool(existing)) {
			self.remove(existing);
		}
		self.insert(widget, index);
		return null;
	}
	, 1, [null,null,'self', 'index', 'widget']);
	cls_definition.insert = pyjs__bind_method(cls_instance, 'insert', function(widget, beforeIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			beforeIndex = arguments[2];
		}
		var td,tr;
		widget.removeFromParent();
		tr = pyjamas.ui.VerticalPanel.DOM.createTR();
		td = pyjamas.ui.VerticalPanel.DOM.createTD();
		pyjamas.ui.VerticalPanel.DOM.insertChild(self.getBody(), tr, beforeIndex);
		pyjamas.ui.VerticalPanel.DOM.appendChild(tr, td);
		pyjamas.ui.VerticalPanel.CellPanel.insert(self, widget, td, beforeIndex);
		self.setCellHorizontalAlignment(widget, self.horzAlign);
		self.setCellVerticalAlignment(widget, self.vertAlign);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'beforeIndex']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}
		var td,tr;
		if (pyjslib.bool(pyjslib.isinstance(widget, pyjslib.int_))) {
			widget = self.getWidget(widget);
		}
		if (pyjslib.bool(!pyjslib.eq(widget.getParent(), self))) {
			return false;
		}
		td = pyjamas.ui.VerticalPanel.DOM.getParent(widget.getElement());
		tr = pyjamas.ui.VerticalPanel.DOM.getParent(td);
		pyjamas.ui.VerticalPanel.DOM.removeChild(self.getBody(), tr);
		pyjamas.ui.VerticalPanel.CellPanel.remove(self, widget);
		return true;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.setHorizontalAlignment = pyjs__bind_method(cls_instance, 'setHorizontalAlignment', function(align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			align = arguments[1];
		}

		self.horzAlign = align;
		return null;
	}
	, 1, [null,null,'self', 'align']);
	cls_definition.setVerticalAlignment = pyjs__bind_method(cls_instance, 'setVerticalAlignment', function(align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			align = arguments[1];
		}

		self.vertAlign = align;
		return null;
	}
	, 1, [null,null,'self', 'align']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.VerticalPanel.CellPanel));
})();
return this;
}; /* end pyjamas.ui.VerticalPanel */
$pyjs.modules_hash['pyjamas.ui.VerticalPanel'] = $pyjs.loaded_modules['pyjamas.ui.VerticalPanel'];


 /* end module: pyjamas.ui.VerticalPanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.CellPanel.CellPanel', 'pyjamas.ui', 'pyjamas.ui.CellPanel', 'pyjamas.ui.HasHorizontalAlignment', 'pyjamas.ui.HasVerticalAlignment']
*/

/* start module: pyjamas.ui.CellPanel */
pyjamas.ui.CellPanel = $pyjs.loaded_modules["pyjamas.ui.CellPanel"] = function (__mod_name__) {
if(pyjamas.ui.CellPanel.__was_initialized__) return pyjamas.ui.CellPanel;
pyjamas.ui.CellPanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.CellPanel';
var __name__ = pyjamas.ui.CellPanel.__name__ = __mod_name__;
var CellPanel = pyjamas.ui.CellPanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.CellPanel');
pyjamas.ui.CellPanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.pyjamas.ui.ComplexPanel', 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.ComplexPanel'], 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.CellPanel');
pyjamas.ui.CellPanel.ComplexPanel = $pyjs.__modules__.pyjamas.ui.ComplexPanel.ComplexPanel;
pyjamas.ui.CellPanel.CellPanel = (function(){
	var cls_instance = pyjs__class_instance('CellPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'f8fd4249edc593bc63bafa679f239064';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		self.table = pyjamas.ui.CellPanel.DOM.createTable();
		self.setElement(self.table);
		self.body = pyjamas.ui.CellPanel.DOM.createTBody();
		self.spacing = null;
		self.padding = null;
		pyjamas.ui.CellPanel.DOM.appendChild(self.table, self.body);
		pyjs_kwargs_call(pyjamas.ui.CellPanel.ComplexPanel, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.getTable = pyjs__bind_method(cls_instance, 'getTable', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.table;
	}
	, 1, [null,null,'self']);
	cls_definition.getBody = pyjs__bind_method(cls_instance, 'getBody', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.body;
	}
	, 1, [null,null,'self']);
	cls_definition.getSpacing = pyjs__bind_method(cls_instance, 'getSpacing', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.spacing;
	}
	, 1, [null,null,'self']);
	cls_definition.getPadding = pyjs__bind_method(cls_instance, 'getPadding', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.padding;
	}
	, 1, [null,null,'self']);
	cls_definition.getWidgetTd = pyjs__bind_method(cls_instance, 'getWidgetTd', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool(!pyjslib.eq(widget.getParent(), self))) {
			return null;
		}
		return pyjamas.ui.CellPanel.DOM.getParent(widget.getElement());
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.setBorderWidth = pyjs__bind_method(cls_instance, 'setBorderWidth', function(width) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			width = arguments[1];
		}

		pyjamas.ui.CellPanel.DOM.setAttribute(self.table, String('border'), pyjslib.sprintf(String('%d'), width));
		return null;
	}
	, 1, [null,null,'self', 'width']);
	cls_definition.setCellHeight = pyjs__bind_method(cls_instance, 'setCellHeight', function(widget, height) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			height = arguments[2];
		}
		var td;
		td = pyjamas.ui.CellPanel.DOM.getParent(widget.getElement());
		pyjamas.ui.CellPanel.DOM.setAttribute(td, String('height'), height);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'height']);
	cls_definition.setCellHorizontalAlignment = pyjs__bind_method(cls_instance, 'setCellHorizontalAlignment', function(widget, align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			align = arguments[2];
		}
		var td;
		td = self.getWidgetTd(widget);
		if (pyjslib.bool((td !== null))) {
			pyjamas.ui.CellPanel.DOM.setAttribute(td, String('align'), align);
		}
		return null;
	}
	, 1, [null,null,'self', 'widget', 'align']);
	cls_definition.setCellVerticalAlignment = pyjs__bind_method(cls_instance, 'setCellVerticalAlignment', function(widget, align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			align = arguments[2];
		}
		var td;
		td = self.getWidgetTd(widget);
		if (pyjslib.bool((td !== null))) {
			pyjamas.ui.CellPanel.DOM.setStyleAttribute(td, String('verticalAlign'), align);
		}
		return null;
	}
	, 1, [null,null,'self', 'widget', 'align']);
	cls_definition.setCellWidth = pyjs__bind_method(cls_instance, 'setCellWidth', function(widget, width) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			width = arguments[2];
		}
		var td;
		td = pyjamas.ui.CellPanel.DOM.getParent(widget.getElement());
		pyjamas.ui.CellPanel.DOM.setAttribute(td, String('width'), width);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'width']);
	cls_definition.setSpacing = pyjs__bind_method(cls_instance, 'setSpacing', function(spacing) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			spacing = arguments[1];
		}

		self.spacing = spacing;
		pyjamas.ui.CellPanel.DOM.setAttribute(self.table, String('cellSpacing'), pyjslib.str(spacing));
		return null;
	}
	, 1, [null,null,'self', 'spacing']);
	cls_definition.setPadding = pyjs__bind_method(cls_instance, 'setPadding', function(padding) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			padding = arguments[1];
		}

		self.padding = padding;
		pyjamas.ui.CellPanel.DOM.setAttribute(self.table, String('cellPadding'), pyjslib.str(padding));
		return null;
	}
	, 1, [null,null,'self', 'padding']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.CellPanel.ComplexPanel));
})();
return this;
}; /* end pyjamas.ui.CellPanel */
$pyjs.modules_hash['pyjamas.ui.CellPanel'] = $pyjs.loaded_modules['pyjamas.ui.CellPanel'];


 /* end module: pyjamas.ui.CellPanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui', 'pyjamas.ui.ComplexPanel']
*/

/* start module: pyjamas.ui.TabBar */
pyjamas.ui.TabBar = $pyjs.loaded_modules["pyjamas.ui.TabBar"] = function (__mod_name__) {
if(pyjamas.ui.TabBar.__was_initialized__) return pyjamas.ui.TabBar;
pyjamas.ui.TabBar.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.TabBar';
var __name__ = pyjamas.ui.TabBar.__name__ = __mod_name__;
var TabBar = pyjamas.ui.TabBar;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.TabBar');
pyjamas.ui.TabBar.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Composite.Composite', 'pyjamas.ui.pyjamas.ui.Composite', 'pyjamas.ui.Composite.Composite', 'pyjamas.ui.Composite'], 'pyjamas.ui.Composite.Composite', 'pyjamas.ui.TabBar');
pyjamas.ui.TabBar.Composite = $pyjs.__modules__.pyjamas.ui.Composite.Composite;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.TabBar');
pyjamas.ui.TabBar.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.HTML.HTML', 'pyjamas.ui.pyjamas.ui.HTML', 'pyjamas.ui.HTML.HTML', 'pyjamas.ui.HTML'], 'pyjamas.ui.HTML.HTML', 'pyjamas.ui.TabBar');
pyjamas.ui.TabBar.HTML = $pyjs.__modules__.pyjamas.ui.HTML.HTML;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Label.Label', 'pyjamas.ui.pyjamas.ui.Label', 'pyjamas.ui.Label.Label', 'pyjamas.ui.Label'], 'pyjamas.ui.Label.Label', 'pyjamas.ui.TabBar');
pyjamas.ui.TabBar.Label = $pyjs.__modules__.pyjamas.ui.Label.Label;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.HorizontalPanel.HorizontalPanel', 'pyjamas.ui.pyjamas.ui.HorizontalPanel', 'pyjamas.ui.HorizontalPanel.HorizontalPanel', 'pyjamas.ui.HorizontalPanel'], 'pyjamas.ui.HorizontalPanel.HorizontalPanel', 'pyjamas.ui.TabBar');
pyjamas.ui.TabBar.HorizontalPanel = $pyjs.__modules__.pyjamas.ui.HorizontalPanel.HorizontalPanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.ClickDelegatePanel.ClickDelegatePanel', 'pyjamas.ui.pyjamas.ui.ClickDelegatePanel', 'pyjamas.ui.ClickDelegatePanel.ClickDelegatePanel', 'pyjamas.ui.ClickDelegatePanel'], 'pyjamas.ui.ClickDelegatePanel.ClickDelegatePanel', 'pyjamas.ui.TabBar');
pyjamas.ui.TabBar.ClickDelegatePanel = $pyjs.__modules__.pyjamas.ui.ClickDelegatePanel.ClickDelegatePanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.HasAlignment', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.HasAlignment', 'pyjamas.ui'], 'pyjamas.ui.HasAlignment', 'pyjamas.ui.TabBar');
pyjamas.ui.TabBar.HasAlignment = $pyjs.__modules__.pyjamas.ui.HasAlignment;
pyjamas.ui.TabBar.TabBar = (function(){
	var cls_instance = pyjs__class_instance('TabBar');
	var cls_definition = new Object();
	cls_definition.__md5__ = '69b2761064242c4ec08fbd9ae5df47f7';
	cls_definition.STYLENAME_DEFAULT = String('gwt-TabBarItem');
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}
		var first,rest;
		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), String('gwt-TabBar'));
		}
		self.panel = pyjamas.ui.TabBar.HorizontalPanel();
		self.selectedTab = null;
		self.tabListeners = new pyjslib.List([]);
		self.panel.setVerticalAlignment(pyjamas.ui.TabBar.HasAlignment.ALIGN_BOTTOM);
		first = pyjamas.ui.TabBar.HTML(String('\x26nbsp\x3B'), true);
		rest = pyjamas.ui.TabBar.HTML(String('\x26nbsp\x3B'), true);
		first.setStyleName(String('gwt-TabBarFirst'));
		rest.setStyleName(String('gwt-TabBarRest'));
		first.setHeight(String('100%'));
		rest.setHeight(String('100%'));
		self.panel.add(first);
		self.panel.add(rest);
		first.setHeight(String('100%'));
		self.panel.setCellHeight(first, String('100%'));
		self.panel.setCellWidth(rest, String('100%'));
		pyjs_kwargs_call(pyjamas.ui.TabBar.Composite, '__init__', null, kwargs, [{}, self, self.panel]);
		self.sinkEvents(pyjamas.ui.TabBar.Event.ONCLICK);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.addTab = pyjs__bind_method(cls_instance, 'addTab', function(text, asHTML) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
			asHTML = arguments[2];
		}
		if (typeof asHTML == 'undefined') asHTML=false;

		self.insertTab(text, asHTML, self.getTabCount());
		return null;
	}
	, 1, [null,null,'self', 'text', 'asHTML']);
	cls_definition.addTabListener = pyjs__bind_method(cls_instance, 'addTabListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.tabListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.getSelectedTab = pyjs__bind_method(cls_instance, 'getSelectedTab', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool((self.selectedTab === null))) {
			return -1;
		}
		return  ( self.panel.getWidgetIndex(self.selectedTab) - 1 ) ;
	}
	, 1, [null,null,'self']);
	cls_definition.getTabCount = pyjs__bind_method(cls_instance, 'getTabCount', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return  ( self.panel.getWidgetCount() - 2 ) ;
	}
	, 1, [null,null,'self']);
	cls_definition.getTabHTML = pyjs__bind_method(cls_instance, 'getTabHTML', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}
		var fpe,widget,delPanel,focusablePanel;
		if (pyjslib.bool((pyjslib.cmp(index, self.getTabCount()) != -1))) {
			return null;
		}
		delPanel = self.panel.getWidget( ( index + 1 ) );
		focusablePanel = delPanel.getFocusablePanel();
		widget = focusablePanel.getWidget();
		if (pyjslib.bool(pyjslib.hasattr(widget, String('getHTML')))) {
			return widget.getHTML();
		}
		else if (pyjslib.bool(pyjslib.hasattr(widget, String('getText')))) {
			return widget.getText();
		}
		else {
			fpe = pyjamas.ui.TabBar.DOM.getParent(self.focusablePanel.getElement());
			return pyjamas.ui.TabBar.DOM.getInnerHTML(fpe);
		}
		return null;
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.createTabTextWrapper = pyjs__bind_method(cls_instance, 'createTabTextWrapper', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.insertTab = pyjs__bind_method(cls_instance, 'insertTab', function(text, asHTML, beforeIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
			asHTML = arguments[2];
			beforeIndex = arguments[3];
		}
		if (typeof beforeIndex == 'undefined') beforeIndex=null;
		var item;
		if (pyjslib.bool((beforeIndex === null))) {
			beforeIndex = asHTML;
			asHTML = false;
		}
		if (pyjslib.bool(((pyjslib.cmp(beforeIndex, 0) == -1)) || ((pyjslib.cmp(beforeIndex, self.getTabCount()) == 1)))) {
		}
		if (pyjslib.bool(pyjslib.isinstance(text, pyjslib.str))) {
			if (pyjslib.bool(asHTML)) {
				item = pyjamas.ui.TabBar.HTML(text);
			}
			else {
				item = pyjamas.ui.TabBar.Label(text);
			}
			item.setWordWrap(false);
		}
		else {
			item = text;
		}
		self.insertTabWidget(item, beforeIndex);
		return null;
	}
	, 1, [null,null,'self', 'text', 'asHTML', 'beforeIndex']);
	cls_definition.insertTabWidget = pyjs__bind_method(cls_instance, 'insertTabWidget', function(widget, beforeIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			beforeIndex = arguments[2];
		}
		var focusablePanel,delWidget;
		delWidget = pyjamas.ui.TabBar.ClickDelegatePanel(self, widget, self, self);
		delWidget.setStyleName(self.STYLENAME_DEFAULT);
		focusablePanel = delWidget.getFocusablePanel();
		self.panel.insert(delWidget,  ( beforeIndex + 1 ) );
		self.setStyleName(pyjamas.ui.TabBar.DOM.getParent(delWidget.getElement()),  ( self.STYLENAME_DEFAULT + String('-wrapper') ) , true);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'beforeIndex']);
	cls_definition.onClick = pyjs__bind_method(cls_instance, 'onClick', function(sender) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			sender = arguments[1];
		}
		if (typeof sender == 'undefined') sender=null;
		var i;
		var __i = pyjslib.range(1,  ( self.panel.getWidgetCount() - 1 ) ).__iter__();
		try {
			while (true) {
				var i = __i.next();
				
				if (pyjslib.bool(pyjamas.ui.TabBar.DOM.isOrHasChild(self.panel.getWidget(i).getElement(), sender.getElement()))) {
					return self.selectTab( ( i - 1 ) );
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return false;
	}
	, 1, [null,null,'self', 'sender']);
	cls_definition.removeTab = pyjs__bind_method(cls_instance, 'removeTab', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}
		var toRemove;
		self.checkTabIndex(index);
		toRemove = self.panel.getWidget( ( index + 1 ) );
		if (pyjslib.bool(pyjslib.eq(toRemove, self.selectedTab))) {
			self.selectedTab = null;
		}
		self.panel.remove(toRemove);
		return null;
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.removeTabListener = pyjs__bind_method(cls_instance, 'removeTabListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.tabListeners.remove(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.selectTab = pyjs__bind_method(cls_instance, 'selectTab', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}
		var listener;
		self.checkTabIndex(index);
		var __listener = self.tabListeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				if (pyjslib.bool(!(listener.onBeforeTabSelected(self, index)))) {
					return false;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		self.setSelectionStyle(self.selectedTab, false);
		if (pyjslib.bool(pyjslib.eq(index, -1))) {
			self.selectedTab = null;
			return true;
		}
		self.selectedTab = self.panel.getWidget( ( index + 1 ) );
		self.setSelectionStyle(self.selectedTab, true);
		var __listener = self.tabListeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onTabSelected(self, index);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return true;
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.checkTabIndex = pyjs__bind_method(cls_instance, 'checkTabIndex', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		if (pyjslib.bool(((pyjslib.cmp(index, -1) == -1)) || ((pyjslib.cmp(index, self.getTabCount()) != -1)))) {
		}
		return null;
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.setSelectionStyle = pyjs__bind_method(cls_instance, 'setSelectionStyle', function(item, selected) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			item = arguments[1];
			selected = arguments[2];
		}

		if (pyjslib.bool((item !== null))) {
			if (pyjslib.bool(selected)) {
				item.addStyleName(String('gwt-TabBarItem-selected'));
				self.setStyleName(pyjamas.ui.TabBar.DOM.getParent(item.getElement()), String('gwt-TabBarItem-wrapper-selected'), true);
			}
			else {
				item.removeStyleName(String('gwt-TabBarItem-selected'));
				self.setStyleName(pyjamas.ui.TabBar.DOM.getParent(item.getElement()), String('gwt-TabBarItem-wrapper-selected'), false);
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'item', 'selected']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.TabBar.Composite));
})();
return this;
}; /* end pyjamas.ui.TabBar */
$pyjs.modules_hash['pyjamas.ui.TabBar'] = $pyjs.loaded_modules['pyjamas.ui.TabBar'];


 /* end module: pyjamas.ui.TabBar */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Composite.Composite', 'pyjamas.ui', 'pyjamas.ui.Composite', 'pyjamas.ui.Event', 'pyjamas.ui.HTML.HTML', 'pyjamas.ui.HTML', 'pyjamas.ui.Label.Label', 'pyjamas.ui.Label', 'pyjamas.ui.HorizontalPanel.HorizontalPanel', 'pyjamas.ui.HorizontalPanel', 'pyjamas.ui.ClickDelegatePanel.ClickDelegatePanel', 'pyjamas.ui.ClickDelegatePanel', 'pyjamas.ui.HasAlignment']
*/

/* start module: pyjamas.ui.HTML */
pyjamas.ui.HTML = $pyjs.loaded_modules["pyjamas.ui.HTML"] = function (__mod_name__) {
if(pyjamas.ui.HTML.__was_initialized__) return pyjamas.ui.HTML;
pyjamas.ui.HTML.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.HTML';
var __name__ = pyjamas.ui.HTML.__name__ = __mod_name__;
var HTML = pyjamas.ui.HTML;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.HTML');
pyjamas.ui.HTML.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Label.Label', 'pyjamas.ui.pyjamas.ui.Label', 'pyjamas.ui.Label.Label', 'pyjamas.ui.Label'], 'pyjamas.ui.Label.Label', 'pyjamas.ui.HTML');
pyjamas.ui.HTML.Label = $pyjs.__modules__.pyjamas.ui.Label.Label;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.HTML');
pyjamas.ui.HTML.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjamas.ui.HTML.HTML = (function(){
	var cls_instance = pyjs__class_instance('HTML');
	var cls_definition = new Object();
	cls_definition.__md5__ = '798cbd3ced816069e80070e4f581c775';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(html, wordWrap, element) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 4 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			html = arguments[1];
			wordWrap = arguments[2];
			element = arguments[3];
			var kwargs = arguments.length >= 5 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof element != 'undefined') {
				if (pyjslib.get_pyjs_classtype(element) == 'Dict') {
					kwargs = element;
					element = arguments[4];
				}
			} else 			if (typeof wordWrap != 'undefined') {
				if (pyjslib.get_pyjs_classtype(wordWrap) == 'Dict') {
					kwargs = wordWrap;
					wordWrap = arguments[4];
				}
			} else 			if (typeof html != 'undefined') {
				if (pyjslib.get_pyjs_classtype(html) == 'Dict') {
					kwargs = html;
					html = arguments[4];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[4];
				}
			} else {
			}
		}
		if (typeof html == 'undefined') html=null;
		if (typeof wordWrap == 'undefined') wordWrap=true;
		if (typeof element == 'undefined') element=null;

		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), String('gwt-HTML'));
		}
		if (pyjslib.bool(html)) {
			kwargs.__setitem__(String('HTML'), html);
		}
		kwargs.__setitem__(String('WordWrap'), wordWrap);
		if (pyjslib.bool((element === null))) {
			element = pyjamas.ui.HTML.DOM.createDiv();
		}
		self.setElement(element);
		pyjs_kwargs_call(pyjamas.ui.HTML.Label, '__init__', null, kwargs, [{}, self]);
		self.sinkEvents(((pyjamas.ui.HTML.Event.ONCLICK | pyjamas.ui.HTML.Event.MOUSEEVENTS)));
		return null;
	}
	, 1, [null,'kwargs','self', 'html', 'wordWrap', 'element']);
	cls_definition.getHTML = pyjs__bind_method(cls_instance, 'getHTML', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.HTML.DOM.getInnerHTML(self.getElement());
	}
	, 1, [null,null,'self']);
	cls_definition.setHTML = pyjs__bind_method(cls_instance, 'setHTML', function(html) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			html = arguments[1];
		}

		pyjamas.ui.HTML.DOM.setInnerHTML(self.getElement(), html);
		return null;
	}
	, 1, [null,null,'self', 'html']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.HTML.Label));
})();
return this;
}; /* end pyjamas.ui.HTML */
$pyjs.modules_hash['pyjamas.ui.HTML'] = $pyjs.loaded_modules['pyjamas.ui.HTML'];


 /* end module: pyjamas.ui.HTML */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Label.Label', 'pyjamas.ui', 'pyjamas.ui.Label', 'pyjamas.ui.Event']
*/

/* start module: pyjamas.ui.Label */
pyjamas.ui.Label = $pyjs.loaded_modules["pyjamas.ui.Label"] = function (__mod_name__) {
if(pyjamas.ui.Label.__was_initialized__) return pyjamas.ui.Label;
pyjamas.ui.Label.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Label';
var __name__ = pyjamas.ui.Label.__name__ = __mod_name__;
var Label = pyjamas.ui.Label;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.Label');
pyjamas.ui.Label.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Widget.Widget', 'pyjamas.ui.pyjamas.ui.Widget', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Widget'], 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Label');
pyjamas.ui.Label.Widget = $pyjs.__modules__.pyjamas.ui.Widget.Widget;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.Label');
pyjamas.ui.Label.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.MouseListener', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.MouseListener', 'pyjamas.ui'], 'pyjamas.ui.MouseListener', 'pyjamas.ui.Label');
pyjamas.ui.Label.MouseListener = $pyjs.__modules__.pyjamas.ui.MouseListener;
pyjamas.ui.Label.Label = (function(){
	var cls_instance = pyjs__class_instance('Label');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'ac8001ab601f3cf31a8614cbddf18d57';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(text, wordWrap) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			text = arguments[1];
			wordWrap = arguments[2];
			var kwargs = arguments.length >= 4 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof wordWrap != 'undefined') {
				if (pyjslib.get_pyjs_classtype(wordWrap) == 'Dict') {
					kwargs = wordWrap;
					wordWrap = arguments[3];
				}
			} else 			if (typeof text != 'undefined') {
				if (pyjslib.get_pyjs_classtype(text) == 'Dict') {
					kwargs = text;
					text = arguments[3];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[3];
				}
			} else {
			}
		}
		if (typeof text == 'undefined') text=null;
		if (typeof wordWrap == 'undefined') wordWrap=true;

		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), String('gwt-Label'));
		}
		if (pyjslib.bool(text)) {
			kwargs.__setitem__(String('Text'), text);
		}
		kwargs.__setitem__(String('WordWrap'), wordWrap);
		self.setElement(pyjamas.ui.Label.DOM.createDiv());
		self.horzAlign = String('');
		self.clickListeners = new pyjslib.List([]);
		self.mouseListeners = new pyjslib.List([]);
		pyjs_kwargs_call(pyjamas.ui.Label.Widget, '__init__', null, kwargs, [{}, self]);
		self.sinkEvents(((pyjamas.ui.Label.Event.ONCLICK | pyjamas.ui.Label.Event.MOUSEEVENTS)));
		return null;
	}
	, 1, [null,'kwargs','self', 'text', 'wordWrap']);
	cls_definition.addClickListener = pyjs__bind_method(cls_instance, 'addClickListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.clickListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.addMouseListener = pyjs__bind_method(cls_instance, 'addMouseListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.mouseListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.getHorizontalAlignment = pyjs__bind_method(cls_instance, 'getHorizontalAlignment', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.horzAlign;
	}
	, 1, [null,null,'self']);
	cls_definition.getText = pyjs__bind_method(cls_instance, 'getText', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.Label.DOM.getInnerText(self.getElement());
	}
	, 1, [null,null,'self']);
	cls_definition.getWordWrap = pyjs__bind_method(cls_instance, 'getWordWrap', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return !(pyjslib.eq(pyjamas.ui.Label.DOM.getStyleAttribute(self.getElement(), String('whiteSpace')), String('nowrap')));
	}
	, 1, [null,null,'self']);
	cls_definition.onBrowserEvent = pyjs__bind_method(cls_instance, 'onBrowserEvent', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var listener,type;
		type = pyjamas.ui.Label.DOM.eventGetType(event);
		if (pyjslib.bool(pyjslib.eq(type, String('click')))) {
			var __listener = self.clickListeners.__iter__();
			try {
				while (true) {
					var listener = __listener.next();
					
					if (pyjslib.bool(pyjslib.hasattr(listener, String('onClick')))) {
						listener.onClick(self);
					}
					else {
						listener(self);
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else if (pyjslib.bool((pyjslib.eq(type, String('mousedown'))) || (pyjslib.eq(type, String('mouseup'))) || (pyjslib.eq(type, String('mousemove'))) || (pyjslib.eq(type, String('mouseover'))) || (pyjslib.eq(type, String('mouseout'))))) {
			pyjamas.ui.Label.MouseListener.fireMouseEvent(self.mouseListeners, self, event);
		}
		else {
			pyjamas.ui.Label.Widget.onBrowserEvent(self, event);
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition.removeClickListener = pyjs__bind_method(cls_instance, 'removeClickListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.clickListeners.remove(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.removeMouseListener = pyjs__bind_method(cls_instance, 'removeMouseListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.mouseListeners.remove(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.setHorizontalAlignment = pyjs__bind_method(cls_instance, 'setHorizontalAlignment', function(align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			align = arguments[1];
		}

		self.horzAlign = align;
		pyjamas.ui.Label.DOM.setStyleAttribute(self.getElement(), String('textAlign'), align);
		return null;
	}
	, 1, [null,null,'self', 'align']);
	cls_definition.setText = pyjs__bind_method(cls_instance, 'setText', function(text) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
		}

		pyjamas.ui.Label.DOM.setInnerText(self.getElement(), text);
		return null;
	}
	, 1, [null,null,'self', 'text']);
	cls_definition.setWordWrap = pyjs__bind_method(cls_instance, 'setWordWrap', function(wrap) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			wrap = arguments[1];
		}
		var style;
		if (pyjslib.bool(wrap)) {
			style = String('normal');
		}
		else {
			style = String('nowrap');
		}
		pyjamas.ui.Label.DOM.setStyleAttribute(self.getElement(), String('whiteSpace'), style);
		return null;
	}
	, 1, [null,null,'self', 'wrap']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.Label.Widget));
})();
return this;
}; /* end pyjamas.ui.Label */
$pyjs.modules_hash['pyjamas.ui.Label'] = $pyjs.loaded_modules['pyjamas.ui.Label'];


 /* end module: pyjamas.ui.Label */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui', 'pyjamas.ui.Widget', 'pyjamas.ui.Event', 'pyjamas.ui.MouseListener']
*/

/* start module: pyjamas.ui.MouseListener */
pyjamas.ui.MouseListener = $pyjs.loaded_modules["pyjamas.ui.MouseListener"] = function (__mod_name__) {
if(pyjamas.ui.MouseListener.__was_initialized__) return pyjamas.ui.MouseListener;
pyjamas.ui.MouseListener.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.MouseListener';
var __name__ = pyjamas.ui.MouseListener.__name__ = __mod_name__;
var MouseListener = pyjamas.ui.MouseListener;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.MouseListener');
pyjamas.ui.MouseListener.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjamas.ui.MouseListener.fireMouseEvent = function(listeners, sender, event) {
	var from_element,listener,to_element,y,x,type;
	x =  ( pyjamas.ui.MouseListener.DOM.eventGetClientX(event) - pyjamas.ui.MouseListener.DOM.getAbsoluteLeft(sender.getElement()) ) ;
	y =  ( pyjamas.ui.MouseListener.DOM.eventGetClientY(event) - pyjamas.ui.MouseListener.DOM.getAbsoluteTop(sender.getElement()) ) ;
	type = pyjamas.ui.MouseListener.DOM.eventGetType(event);
	if (pyjslib.bool(pyjslib.eq(type, String('mousedown')))) {
		var __listener = listeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onMouseDown(sender, x, y);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	else if (pyjslib.bool(pyjslib.eq(type, String('mouseup')))) {
		var __listener = listeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onMouseUp(sender, x, y);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	else if (pyjslib.bool(pyjslib.eq(type, String('mousemove')))) {
		var __listener = listeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onMouseMove(sender, x, y);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	else if (pyjslib.bool(pyjslib.eq(type, String('mouseover')))) {
		from_element = pyjamas.ui.MouseListener.DOM.eventGetFromElement(event);
		if (pyjslib.bool(!(pyjamas.ui.MouseListener.DOM.isOrHasChild(sender.getElement(), from_element)))) {
			var __listener = listeners.__iter__();
			try {
				while (true) {
					var listener = __listener.next();
					
					listener.onMouseEnter(sender);
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
	}
	else if (pyjslib.bool(pyjslib.eq(type, String('mouseout')))) {
		to_element = pyjamas.ui.MouseListener.DOM.eventGetToElement(event);
		if (pyjslib.bool(!(pyjamas.ui.MouseListener.DOM.isOrHasChild(sender.getElement(), to_element)))) {
			var __listener = listeners.__iter__();
			try {
				while (true) {
					var listener = __listener.next();
					
					listener.onMouseLeave(sender);
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
	}
	return null;
};
pyjamas.ui.MouseListener.fireMouseEvent.__name__ = 'fireMouseEvent';

pyjamas.ui.MouseListener.fireMouseEvent.__bind_type__ = 0;
pyjamas.ui.MouseListener.fireMouseEvent.__args__ = [null,null,'listeners', 'sender', 'event'];
return this;
}; /* end pyjamas.ui.MouseListener */
$pyjs.modules_hash['pyjamas.ui.MouseListener'] = $pyjs.loaded_modules['pyjamas.ui.MouseListener'];


 /* end module: pyjamas.ui.MouseListener */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas']
*/

/* start module: pyjamas.ui.HorizontalPanel */
pyjamas.ui.HorizontalPanel = $pyjs.loaded_modules["pyjamas.ui.HorizontalPanel"] = function (__mod_name__) {
if(pyjamas.ui.HorizontalPanel.__was_initialized__) return pyjamas.ui.HorizontalPanel;
pyjamas.ui.HorizontalPanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.HorizontalPanel';
var __name__ = pyjamas.ui.HorizontalPanel.__name__ = __mod_name__;
var HorizontalPanel = pyjamas.ui.HorizontalPanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.HorizontalPanel');
pyjamas.ui.HorizontalPanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.CellPanel.CellPanel', 'pyjamas.ui.pyjamas.ui.CellPanel', 'pyjamas.ui.CellPanel.CellPanel', 'pyjamas.ui.CellPanel'], 'pyjamas.ui.CellPanel.CellPanel', 'pyjamas.ui.HorizontalPanel');
pyjamas.ui.HorizontalPanel.CellPanel = $pyjs.__modules__.pyjamas.ui.CellPanel.CellPanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.HasHorizontalAlignment', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.HasHorizontalAlignment', 'pyjamas.ui'], 'pyjamas.ui.HasHorizontalAlignment', 'pyjamas.ui.HorizontalPanel');
pyjamas.ui.HorizontalPanel.HasHorizontalAlignment = $pyjs.__modules__.pyjamas.ui.HasHorizontalAlignment;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.HasVerticalAlignment', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.HasVerticalAlignment', 'pyjamas.ui'], 'pyjamas.ui.HasVerticalAlignment', 'pyjamas.ui.HorizontalPanel');
pyjamas.ui.HorizontalPanel.HasVerticalAlignment = $pyjs.__modules__.pyjamas.ui.HasVerticalAlignment;
pyjamas.ui.HorizontalPanel.HorizontalPanel = (function(){
	var cls_instance = pyjs__class_instance('HorizontalPanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'a44d5afd3c2fd43b4437e1f94670d13a';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		if (pyjslib.bool(!(kwargs.has_key(String('Spacing'))))) {
			kwargs.__setitem__(String('Spacing'), 0);
		}
		if (pyjslib.bool(!(kwargs.has_key(String('Padding'))))) {
			kwargs.__setitem__(String('Padding'), 0);
		}
		self.horzAlign = pyjamas.ui.HorizontalPanel.HasHorizontalAlignment.ALIGN_LEFT;
		self.vertAlign = pyjamas.ui.HorizontalPanel.HasVerticalAlignment.ALIGN_TOP;
		pyjs_kwargs_call(pyjamas.ui.HorizontalPanel.CellPanel, '__init__', null, kwargs, [{}, self]);
		self.tableRow = pyjamas.ui.HorizontalPanel.DOM.createTR();
		pyjamas.ui.HorizontalPanel.DOM.appendChild(self.getBody(), self.tableRow);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		self.insert(widget, self.getWidgetCount());
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.getHorizontalAlignment = pyjs__bind_method(cls_instance, 'getHorizontalAlignment', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.horzAlign;
	}
	, 1, [null,null,'self']);
	cls_definition.getVerticalAlignment = pyjs__bind_method(cls_instance, 'getVerticalAlignment', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.vertAlign;
	}
	, 1, [null,null,'self']);
	cls_definition.getWidget = pyjs__bind_method(cls_instance, 'getWidget', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		return self.children.__getitem__(index);
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.getWidgetCount = pyjs__bind_method(cls_instance, 'getWidgetCount', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjslib.len(self.children);
	}
	, 1, [null,null,'self']);
	cls_definition.getWidgetIndex = pyjs__bind_method(cls_instance, 'getWidgetIndex', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		return self.children.index(child);
	}
	, 1, [null,null,'self', 'child']);
	cls_definition.insert = pyjs__bind_method(cls_instance, 'insert', function(widget, beforeIndex) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			beforeIndex = arguments[2];
		}
		var td;
		widget.removeFromParent();
		td = pyjamas.ui.HorizontalPanel.DOM.createTD();
		pyjamas.ui.HorizontalPanel.DOM.insertChild(self.tableRow, td, beforeIndex);
		pyjamas.ui.HorizontalPanel.CellPanel.insert(self, widget, td, beforeIndex);
		self.setCellHorizontalAlignment(widget, self.horzAlign);
		self.setCellVerticalAlignment(widget, self.vertAlign);
		return null;
	}
	, 1, [null,null,'self', 'widget', 'beforeIndex']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}
		var td;
		if (pyjslib.bool(pyjslib.isinstance(widget, pyjslib.int_))) {
			widget = self.getWidget(widget);
		}
		if (pyjslib.bool(!pyjslib.eq(widget.getParent(), self))) {
			return false;
		}
		td = pyjamas.ui.HorizontalPanel.DOM.getParent(widget.getElement());
		pyjamas.ui.HorizontalPanel.DOM.removeChild(self.tableRow, td);
		pyjamas.ui.HorizontalPanel.CellPanel.remove(self, widget);
		return true;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.setHorizontalAlignment = pyjs__bind_method(cls_instance, 'setHorizontalAlignment', function(align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			align = arguments[1];
		}

		self.horzAlign = align;
		return null;
	}
	, 1, [null,null,'self', 'align']);
	cls_definition.setVerticalAlignment = pyjs__bind_method(cls_instance, 'setVerticalAlignment', function(align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			align = arguments[1];
		}

		self.vertAlign = align;
		return null;
	}
	, 1, [null,null,'self', 'align']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.HorizontalPanel.CellPanel));
})();
return this;
}; /* end pyjamas.ui.HorizontalPanel */
$pyjs.modules_hash['pyjamas.ui.HorizontalPanel'] = $pyjs.loaded_modules['pyjamas.ui.HorizontalPanel'];


 /* end module: pyjamas.ui.HorizontalPanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.CellPanel.CellPanel', 'pyjamas.ui', 'pyjamas.ui.CellPanel', 'pyjamas.ui.HasHorizontalAlignment', 'pyjamas.ui.HasVerticalAlignment']
*/

/* start module: pyjamas.ui.ClickDelegatePanel */
pyjamas.ui.ClickDelegatePanel = $pyjs.loaded_modules["pyjamas.ui.ClickDelegatePanel"] = function (__mod_name__) {
if(pyjamas.ui.ClickDelegatePanel.__was_initialized__) return pyjamas.ui.ClickDelegatePanel;
pyjamas.ui.ClickDelegatePanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.ClickDelegatePanel';
var __name__ = pyjamas.ui.ClickDelegatePanel.__name__ = __mod_name__;
var ClickDelegatePanel = pyjamas.ui.ClickDelegatePanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.ClickDelegatePanel');
pyjamas.ui.ClickDelegatePanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Composite.Composite', 'pyjamas.ui.pyjamas.ui.Composite', 'pyjamas.ui.Composite.Composite', 'pyjamas.ui.Composite'], 'pyjamas.ui.Composite.Composite', 'pyjamas.ui.ClickDelegatePanel');
pyjamas.ui.ClickDelegatePanel.Composite = $pyjs.__modules__.pyjamas.ui.Composite.Composite;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.ClickDelegatePanel');
pyjamas.ui.ClickDelegatePanel.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Focus', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Focus', 'pyjamas.ui'], 'pyjamas.ui.Focus', 'pyjamas.ui.ClickDelegatePanel');
pyjamas.ui.ClickDelegatePanel.Focus = $pyjs.__modules__.pyjamas.ui.Focus;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui.pyjamas.ui.SimplePanel', 'pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui.SimplePanel'], 'pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui.ClickDelegatePanel');
pyjamas.ui.ClickDelegatePanel.SimplePanel = $pyjs.__modules__.pyjamas.ui.SimplePanel.SimplePanel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.KeyboardListener', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.KeyboardListener', 'pyjamas.ui'], 'pyjamas.ui.KeyboardListener', 'pyjamas.ui.ClickDelegatePanel');
pyjamas.ui.ClickDelegatePanel.KeyboardListener = $pyjs.__modules__.pyjamas.ui.KeyboardListener;
pyjamas.ui.ClickDelegatePanel.ClickDelegatePanel = (function(){
	var cls_instance = pyjs__class_instance('ClickDelegatePanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = '9361bbc8e19be0f528e5f5b1e282438d';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(p, child, cDelegate, kDelegate) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			p = arguments[1];
			child = arguments[2];
			cDelegate = arguments[3];
			kDelegate = arguments[4];
		}
		var wrapperWidget;
		pyjamas.ui.ClickDelegatePanel.Composite.__init__(self);
		self.clickDelegate = cDelegate;
		self.keyDelegate = kDelegate;
		self.focusablePanel = pyjamas.ui.ClickDelegatePanel.SimplePanel(pyjamas.ui.ClickDelegatePanel.Focus.createFocusable());
		self.focusablePanel.setWidget(child);
		wrapperWidget = p.createTabTextWrapper();
		if (pyjslib.bool((wrapperWidget === null))) {
			self.initWidget(self.focusablePanel);
		}
		else {
			wrapperWidget.setWidget(self.focusablePanel);
			self.initWidget(wrapperWidget);
		}
		if (pyjslib.bool(pyjslib.hasattr(child, String('addKeyboardListener')))) {
			child.addKeyboardListener(kDelegate);
		}
		self.sinkEvents(((pyjamas.ui.ClickDelegatePanel.Event.ONCLICK | pyjamas.ui.ClickDelegatePanel.Event.ONKEYDOWN)));
		return null;
	}
	, 1, [null,null,'self', 'p', 'child', 'cDelegate', 'kDelegate']);
	cls_definition.onClick = pyjs__bind_method(cls_instance, 'onClick', function(sender) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			sender = arguments[1];
		}
		if (typeof sender == 'undefined') sender=null;

		self.clickDelegate.onClick(sender);
		return null;
	}
	, 1, [null,null,'self', 'sender']);
	cls_definition.getFocusablePanel = pyjs__bind_method(cls_instance, 'getFocusablePanel', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.focusablePanel;
	}
	, 1, [null,null,'self']);
	cls_definition.onBrowserEvent = pyjs__bind_method(cls_instance, 'onBrowserEvent', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var modifiers,type;
		type = pyjamas.ui.ClickDelegatePanel.DOM.eventGetType(event);
		if (pyjslib.bool(pyjslib.eq(type, String('click')))) {
			self.onClick(self);
		}
		else if (pyjslib.bool(pyjslib.eq(type, String('keydown')))) {
			modifiers = pyjamas.ui.ClickDelegatePanel.KeyboardListener.getKeyboardModifiers(event);
			if (pyjslib.bool(pyjslib.hasattr(self.keyDelegate, String('onKeyDown')))) {
				self.keyDelegate.onKeyDown(self, pyjamas.ui.ClickDelegatePanel.DOM.eventGetKeyCode(event), modifiers);
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.ClickDelegatePanel.Composite));
})();
return this;
}; /* end pyjamas.ui.ClickDelegatePanel */
$pyjs.modules_hash['pyjamas.ui.ClickDelegatePanel'] = $pyjs.loaded_modules['pyjamas.ui.ClickDelegatePanel'];


 /* end module: pyjamas.ui.ClickDelegatePanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Composite.Composite', 'pyjamas.ui', 'pyjamas.ui.Composite', 'pyjamas.ui.Event', 'pyjamas.ui.Focus', 'pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui.SimplePanel', 'pyjamas.ui.KeyboardListener']
*/

/* start module: pyjamas.ui.Focus */
pyjamas.ui.Focus = $pyjs.loaded_modules["pyjamas.ui.Focus"] = function (__mod_name__) {
if(pyjamas.ui.Focus.__was_initialized__) return pyjamas.ui.Focus;
pyjamas.ui.Focus.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Focus';
var __name__ = pyjamas.ui.Focus.__name__ = __mod_name__;
var Focus = pyjamas.ui.Focus;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.Focus');
pyjamas.ui.Focus.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjamas.ui.Focus.blur = function(elem) {


    elem.firstChild.blur();
    
};
pyjamas.ui.Focus.blur.__name__ = 'blur';

pyjamas.ui.Focus.blur.__bind_type__ = 0;
pyjamas.ui.Focus.blur.__args__ = [null,null,'elem'];
pyjamas.ui.Focus.createFocusable = function() {


    var div = $doc.createElement('div');
    var input = $doc.createElement('input');
    input.type = 'text';
    input.style.width = input.style.height = 0;
    input.style.zIndex = -1;
    input.style.position = 'absolute';

    input.addEventListener(
        'blur',
        function(evt) { if (this.parentNode.onblur) this.parentNode.onblur(evt); },
        false);

    input.addEventListener(
        'focus',
        function(evt) { if (this.parentNode.onfocus) this.parentNode.onfocus(evt); },
        false);

    div.addEventListener(
        'mousedown',
        function(evt) { this.firstChild.focus(); },
        false);
    
    div.appendChild(input);
    return div;
    
};
pyjamas.ui.Focus.createFocusable.__name__ = 'createFocusable';

pyjamas.ui.Focus.createFocusable.__bind_type__ = 0;
pyjamas.ui.Focus.createFocusable.__args__ = [null,null];
pyjamas.ui.Focus.focus = function(elem) {


    elem.firstChild.focus();
    
};
pyjamas.ui.Focus.focus.__name__ = 'focus';

pyjamas.ui.Focus.focus.__bind_type__ = 0;
pyjamas.ui.Focus.focus.__args__ = [null,null,'elem'];
pyjamas.ui.Focus.getTabIndex = function(elem) {


    return elem.firstChild.tabIndex;
    
};
pyjamas.ui.Focus.getTabIndex.__name__ = 'getTabIndex';

pyjamas.ui.Focus.getTabIndex.__bind_type__ = 0;
pyjamas.ui.Focus.getTabIndex.__args__ = [null,null,'elem'];
pyjamas.ui.Focus.setAccessKey = function(elem, key) {


    if (elem.firstChild != null) elem.firstChild.accessKey = key;
    
};
pyjamas.ui.Focus.setAccessKey.__name__ = 'setAccessKey';

pyjamas.ui.Focus.setAccessKey.__bind_type__ = 0;
pyjamas.ui.Focus.setAccessKey.__args__ = [null,null,'elem', 'key'];
pyjamas.ui.Focus.setTabIndex = function(elem, index) {


    if (elem.firstChild != null) elem.firstChild.tabIndex = index;
    
};
pyjamas.ui.Focus.setTabIndex.__name__ = 'setTabIndex';

pyjamas.ui.Focus.setTabIndex.__bind_type__ = 0;
pyjamas.ui.Focus.setTabIndex.__args__ = [null,null,'elem', 'index'];
return this;
}; /* end pyjamas.ui.Focus */
$pyjs.modules_hash['pyjamas.ui.Focus'] = $pyjs.loaded_modules['pyjamas.ui.Focus'];


 /* end module: pyjamas.ui.Focus */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas']
*/

/* start module: pyjamas.ui.KeyboardListener */
pyjamas.ui.KeyboardListener = $pyjs.loaded_modules["pyjamas.ui.KeyboardListener"] = function (__mod_name__) {
if(pyjamas.ui.KeyboardListener.__was_initialized__) return pyjamas.ui.KeyboardListener;
pyjamas.ui.KeyboardListener.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.KeyboardListener';
var __name__ = pyjamas.ui.KeyboardListener.__name__ = __mod_name__;
var KeyboardListener = pyjamas.ui.KeyboardListener;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.KeyboardListener');
pyjamas.ui.KeyboardListener.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjamas.ui.KeyboardListener.KEY_ALT = 18;
pyjamas.ui.KeyboardListener.KEY_BACKSPACE = 8;
pyjamas.ui.KeyboardListener.KEY_CTRL = 17;
pyjamas.ui.KeyboardListener.KEY_DELETE = 46;
pyjamas.ui.KeyboardListener.KEY_DOWN = 40;
pyjamas.ui.KeyboardListener.KEY_END = 35;
pyjamas.ui.KeyboardListener.KEY_ENTER = 13;
pyjamas.ui.KeyboardListener.KEY_ESCAPE = 27;
pyjamas.ui.KeyboardListener.KEY_HOME = 36;
pyjamas.ui.KeyboardListener.KEY_LEFT = 37;
pyjamas.ui.KeyboardListener.KEY_PAGEDOWN = 34;
pyjamas.ui.KeyboardListener.KEY_PAGEUP = 33;
pyjamas.ui.KeyboardListener.KEY_RIGHT = 39;
pyjamas.ui.KeyboardListener.KEY_SHIFT = 16;
pyjamas.ui.KeyboardListener.KEY_TAB = 9;
pyjamas.ui.KeyboardListener.KEY_UP = 38;
pyjamas.ui.KeyboardListener.MODIFIER_ALT = 4;
pyjamas.ui.KeyboardListener.MODIFIER_CTRL = 2;
pyjamas.ui.KeyboardListener.MODIFIER_SHIFT = 1;
pyjamas.ui.KeyboardListener.getKeyboardModifiers = function(event) {
	var shift,alt,ctrl;
	shift = 0;
	ctrl = 0;
	alt = 0;
	if (pyjslib.bool(pyjamas.ui.KeyboardListener.DOM.eventGetShiftKey(event))) {
		shift = pyjamas.ui.KeyboardListener.MODIFIER_SHIFT;
	}
	if (pyjslib.bool(pyjamas.ui.KeyboardListener.DOM.eventGetCtrlKey(event))) {
		ctrl = pyjamas.ui.KeyboardListener.MODIFIER_CTRL;
	}
	if (pyjslib.bool(pyjamas.ui.KeyboardListener.DOM.eventGetAltKey(event))) {
		alt = pyjamas.ui.KeyboardListener.MODIFIER_ALT;
	}
	return ((shift | ctrl | alt));
};
pyjamas.ui.KeyboardListener.getKeyboardModifiers.__name__ = 'getKeyboardModifiers';

pyjamas.ui.KeyboardListener.getKeyboardModifiers.__bind_type__ = 0;
pyjamas.ui.KeyboardListener.getKeyboardModifiers.__args__ = [null,null,'event'];
pyjamas.ui.KeyboardListener.fireKeyboardEvent = function(listeners, sender, event) {
	var modifiers,listener,type,keycode;
	modifiers = pyjamas.ui.KeyboardListener.getKeyboardModifiers(event);
	keycode = pyjamas.ui.KeyboardListener.DOM.eventGetKeyCode(event);
	type = pyjamas.ui.KeyboardListener.DOM.eventGetType(event);
	if (pyjslib.bool(pyjslib.eq(type, String('keydown')))) {
		var __listener = listeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onKeyDown(sender, keycode, modifiers);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	else if (pyjslib.bool(pyjslib.eq(type, String('keyup')))) {
		var __listener = listeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onKeyUp(sender, keycode, modifiers);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	else if (pyjslib.bool(pyjslib.eq(type, String('keypress')))) {
		var __listener = listeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onKeyPress(sender, keycode, modifiers);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	return null;
};
pyjamas.ui.KeyboardListener.fireKeyboardEvent.__name__ = 'fireKeyboardEvent';

pyjamas.ui.KeyboardListener.fireKeyboardEvent.__bind_type__ = 0;
pyjamas.ui.KeyboardListener.fireKeyboardEvent.__args__ = [null,null,'listeners', 'sender', 'event'];
return this;
}; /* end pyjamas.ui.KeyboardListener */
$pyjs.modules_hash['pyjamas.ui.KeyboardListener'] = $pyjs.loaded_modules['pyjamas.ui.KeyboardListener'];


 /* end module: pyjamas.ui.KeyboardListener */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas']
*/

/* start module: pyjamas.ui.Button */
pyjamas.ui.Button = $pyjs.loaded_modules["pyjamas.ui.Button"] = function (__mod_name__) {
if(pyjamas.ui.Button.__was_initialized__) return pyjamas.ui.Button;
pyjamas.ui.Button.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Button';
var __name__ = pyjamas.ui.Button.__name__ = __mod_name__;
var Button = pyjamas.ui.Button;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.Button');
pyjamas.ui.Button.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.ButtonBase.ButtonBase', 'pyjamas.ui.pyjamas.ui.ButtonBase', 'pyjamas.ui.ButtonBase.ButtonBase', 'pyjamas.ui.ButtonBase'], 'pyjamas.ui.ButtonBase.ButtonBase', 'pyjamas.ui.Button');
pyjamas.ui.Button.ButtonBase = $pyjs.__modules__.pyjamas.ui.ButtonBase.ButtonBase;
pyjamas.ui.Button.Button = (function(){
	var cls_instance = pyjs__class_instance('Button');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'b6aa18a4312507e0468d07df92877f06';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(html, listener) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			html = arguments[1];
			listener = arguments[2];
			var kwargs = arguments.length >= 4 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof listener != 'undefined') {
				if (pyjslib.get_pyjs_classtype(listener) == 'Dict') {
					kwargs = listener;
					listener = arguments[3];
				}
			} else 			if (typeof html != 'undefined') {
				if (pyjslib.get_pyjs_classtype(html) == 'Dict') {
					kwargs = html;
					html = arguments[3];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[3];
				}
			} else {
			}
		}
		if (typeof html == 'undefined') html=null;
		if (typeof listener == 'undefined') listener=null;
		var element;
		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), String('gwt-Button'));
		}
		if (pyjslib.bool(html)) {
			kwargs.__setitem__(String('HTML'), html);
		}
		element = pyjamas.ui.Button.DOM.createButton();
		pyjs_kwargs_call(pyjamas.ui.Button.ButtonBase, '__init__', null, kwargs, [{}, self, element]);
		self.adjustType(self.getElement());
		if (pyjslib.bool(listener)) {
			self.addClickListener(listener);
		}
		return null;
	}
	, 1, [null,'kwargs','self', 'html', 'listener']);
	cls_definition.adjustType = pyjs__bind_method(cls_instance, 'adjustType', function(button) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			button = arguments[1];
		}
		var err,pyjs_try_err;
		if (pyjslib.bool(pyjslib.eq(button.type, String('submit')))) {
			try {
				pyjamas.ui.Button.DOM.setAttribute(button, String('type'), String('button'));
			} catch(pyjs_try_err) {
				var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
				$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjamas.ui.Button, try_lineno: 39};
				{
					$pyjs.__last_exception__.except_lineno = 42;
					err = pyjs_try_err;
				} 			}
		}
		return null;
	}
	, 1, [null,null,'self', 'button']);
	cls_definition.click = pyjs__bind_method(cls_instance, 'click', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.getElement().click();
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.Button.ButtonBase));
})();
return this;
}; /* end pyjamas.ui.Button */
$pyjs.modules_hash['pyjamas.ui.Button'] = $pyjs.loaded_modules['pyjamas.ui.Button'];


 /* end module: pyjamas.ui.Button */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.ButtonBase.ButtonBase', 'pyjamas.ui', 'pyjamas.ui.ButtonBase']
*/

/* start module: pyjamas.ui.ButtonBase */
pyjamas.ui.ButtonBase = $pyjs.loaded_modules["pyjamas.ui.ButtonBase"] = function (__mod_name__) {
if(pyjamas.ui.ButtonBase.__was_initialized__) return pyjamas.ui.ButtonBase;
pyjamas.ui.ButtonBase.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.ButtonBase';
var __name__ = pyjamas.ui.ButtonBase.__name__ = __mod_name__;
var ButtonBase = pyjamas.ui.ButtonBase;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.ButtonBase');
pyjamas.ui.ButtonBase.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.FocusWidget.FocusWidget', 'pyjamas.ui.pyjamas.ui.FocusWidget', 'pyjamas.ui.FocusWidget.FocusWidget', 'pyjamas.ui.FocusWidget'], 'pyjamas.ui.FocusWidget.FocusWidget', 'pyjamas.ui.ButtonBase');
pyjamas.ui.ButtonBase.FocusWidget = $pyjs.__modules__.pyjamas.ui.FocusWidget.FocusWidget;
pyjamas.ui.ButtonBase.ButtonBase = (function(){
	var cls_instance = pyjs__class_instance('ButtonBase');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'f951fc32a47c4da19b548786a86af478';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			element = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof element != 'undefined') {
				if (pyjslib.get_pyjs_classtype(element) == 'Dict') {
					kwargs = element;
					element = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}

		pyjs_kwargs_call(pyjamas.ui.ButtonBase.FocusWidget, '__init__', null, kwargs, [{}, self, element]);
		return null;
	}
	, 1, [null,'kwargs','self', 'element']);
	cls_definition.getHTML = pyjs__bind_method(cls_instance, 'getHTML', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.ButtonBase.DOM.getInnerHTML(self.getElement());
	}
	, 1, [null,null,'self']);
	cls_definition.getText = pyjs__bind_method(cls_instance, 'getText', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.ButtonBase.DOM.getInnerText(self.getElement());
	}
	, 1, [null,null,'self']);
	cls_definition.setHTML = pyjs__bind_method(cls_instance, 'setHTML', function(html) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			html = arguments[1];
		}

		pyjamas.ui.ButtonBase.DOM.setInnerHTML(self.getElement(), html);
		return null;
	}
	, 1, [null,null,'self', 'html']);
	cls_definition.setText = pyjs__bind_method(cls_instance, 'setText', function(text) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
		}

		pyjamas.ui.ButtonBase.DOM.setInnerText(self.getElement(), text);
		return null;
	}
	, 1, [null,null,'self', 'text']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.ButtonBase.FocusWidget));
})();
return this;
}; /* end pyjamas.ui.ButtonBase */
$pyjs.modules_hash['pyjamas.ui.ButtonBase'] = $pyjs.loaded_modules['pyjamas.ui.ButtonBase'];


 /* end module: pyjamas.ui.ButtonBase */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.FocusWidget.FocusWidget', 'pyjamas.ui', 'pyjamas.ui.FocusWidget']
*/

/* start module: pyjamas.ui.FocusWidget */
pyjamas.ui.FocusWidget = $pyjs.loaded_modules["pyjamas.ui.FocusWidget"] = function (__mod_name__) {
if(pyjamas.ui.FocusWidget.__was_initialized__) return pyjamas.ui.FocusWidget;
pyjamas.ui.FocusWidget.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.FocusWidget';
var __name__ = pyjamas.ui.FocusWidget.__name__ = __mod_name__;
var FocusWidget = pyjamas.ui.FocusWidget;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.FocusWidget');
pyjamas.ui.FocusWidget.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Widget.Widget', 'pyjamas.ui.pyjamas.ui.Widget', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Widget'], 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.FocusWidget');
pyjamas.ui.FocusWidget.Widget = $pyjs.__modules__.pyjamas.ui.Widget.Widget;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Focus', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Focus', 'pyjamas.ui'], 'pyjamas.ui.Focus', 'pyjamas.ui.FocusWidget');
pyjamas.ui.FocusWidget.Focus = $pyjs.__modules__.pyjamas.ui.Focus;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.FocusWidget');
pyjamas.ui.FocusWidget.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.FocusListener', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.FocusListener', 'pyjamas.ui'], 'pyjamas.ui.FocusListener', 'pyjamas.ui.FocusWidget');
pyjamas.ui.FocusWidget.FocusListener = $pyjs.__modules__.pyjamas.ui.FocusListener;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.KeyboardListener', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.KeyboardListener', 'pyjamas.ui'], 'pyjamas.ui.KeyboardListener', 'pyjamas.ui.FocusWidget');
pyjamas.ui.FocusWidget.KeyboardListener = $pyjs.__modules__.pyjamas.ui.KeyboardListener;
pyjamas.ui.FocusWidget.FocusWidget = (function(){
	var cls_instance = pyjs__class_instance('FocusWidget');
	var cls_definition = new Object();
	cls_definition.__md5__ = '58af1403d17845718b5c671fb6a7ea3f';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			element = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof element != 'undefined') {
				if (pyjslib.get_pyjs_classtype(element) == 'Dict') {
					kwargs = element;
					element = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}

		self.setElement(element);
		pyjs_kwargs_call(pyjamas.ui.FocusWidget.Widget, '__init__', null, kwargs, [{}, self]);
		self.clickListeners = new pyjslib.List([]);
		self.focusListeners = new pyjslib.List([]);
		self.keyboardListeners = new pyjslib.List([]);
		self.sinkEvents(((pyjamas.ui.FocusWidget.Event.ONCLICK | pyjamas.ui.FocusWidget.Event.FOCUSEVENTS | pyjamas.ui.FocusWidget.Event.KEYEVENTS)));
		return null;
	}
	, 1, [null,'kwargs','self', 'element']);
	cls_definition.addClickListener = pyjs__bind_method(cls_instance, 'addClickListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.clickListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.addFocusListener = pyjs__bind_method(cls_instance, 'addFocusListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.focusListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.addKeyboardListener = pyjs__bind_method(cls_instance, 'addKeyboardListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.keyboardListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.getTabIndex = pyjs__bind_method(cls_instance, 'getTabIndex', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.FocusWidget.Focus.getTabIndex(self.getElement());
	}
	, 1, [null,null,'self']);
	cls_definition.isEnabled = pyjs__bind_method(cls_instance, 'isEnabled', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var err,pyjs_try_err;
		try {
			return !(pyjamas.ui.FocusWidget.DOM.getBooleanAttribute(self.getElement(), String('disabled')));
		} catch(pyjs_try_err) {
			var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
			$pyjs.__last_exception__ = {error: pyjs_try_err, module: pyjamas.ui.FocusWidget, try_lineno: 45};
			if (pyjs_try_err_name == pyjslib.TypeError.__name__) {
				$pyjs.__last_exception__.except_lineno = 47;
				err = pyjs_try_err;
				return true;
			} else if (pyjs_try_err_name == pyjslib.AttributeError.__name__) {
				$pyjs.__last_exception__.except_lineno = 49;
				err = pyjs_try_err;
				return true;
			} else { throw pyjs_try_err; }
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.onBrowserEvent = pyjs__bind_method(cls_instance, 'onBrowserEvent', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var listener,type;
		type = pyjamas.ui.FocusWidget.DOM.eventGetType(event);
		if (pyjslib.bool(pyjslib.eq(type, String('click')))) {
			var __listener = self.clickListeners.__iter__();
			try {
				while (true) {
					var listener = __listener.next();
					
					if (pyjslib.bool(pyjslib.hasattr(listener, String('onClick')))) {
						listener.onClick(self);
					}
					else {
						listener(self);
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else if (pyjslib.bool((pyjslib.eq(type, String('blur'))) || (pyjslib.eq(type, String('focus'))))) {
			pyjamas.ui.FocusWidget.FocusListener.fireFocusEvent(self.focusListeners, self, event);
		}
		else if (pyjslib.bool((pyjslib.eq(type, String('keydown'))) || (pyjslib.eq(type, String('keypress'))) || (pyjslib.eq(type, String('keyup'))))) {
			pyjamas.ui.FocusWidget.KeyboardListener.fireKeyboardEvent(self.keyboardListeners, self, event);
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition.removeClickListener = pyjs__bind_method(cls_instance, 'removeClickListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.clickListeners.remove(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.removeFocusListener = pyjs__bind_method(cls_instance, 'removeFocusListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.focusListeners.remove(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.removeKeyboardListener = pyjs__bind_method(cls_instance, 'removeKeyboardListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.keyboardListeners.remove(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.setAccessKey = pyjs__bind_method(cls_instance, 'setAccessKey', function(key) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			key = arguments[1];
		}

		pyjamas.ui.FocusWidget.DOM.setAttribute(self.getElement(), String('accessKey'), pyjslib.str(key));
		return null;
	}
	, 1, [null,null,'self', 'key']);
	cls_definition.setEnabled = pyjs__bind_method(cls_instance, 'setEnabled', function(enabled) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			enabled = arguments[1];
		}

		pyjamas.ui.FocusWidget.DOM.setBooleanAttribute(self.getElement(), String('disabled'), !(enabled));
		return null;
	}
	, 1, [null,null,'self', 'enabled']);
	cls_definition.setFocus = pyjs__bind_method(cls_instance, 'setFocus', function(focused) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			focused = arguments[1];
		}

		if (pyjslib.bool(focused)) {
			pyjamas.ui.FocusWidget.Focus.focus(self.getElement());
		}
		else {
			pyjamas.ui.FocusWidget.Focus.blur(self.getElement());
		}
		return null;
	}
	, 1, [null,null,'self', 'focused']);
	cls_definition.setTabIndex = pyjs__bind_method(cls_instance, 'setTabIndex', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		pyjamas.ui.FocusWidget.Focus.setTabIndex(self.getElement(), index);
		return null;
	}
	, 1, [null,null,'self', 'index']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.FocusWidget.Widget));
})();
return this;
}; /* end pyjamas.ui.FocusWidget */
$pyjs.modules_hash['pyjamas.ui.FocusWidget'] = $pyjs.loaded_modules['pyjamas.ui.FocusWidget'];


 /* end module: pyjamas.ui.FocusWidget */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui', 'pyjamas.ui.Widget', 'pyjamas.ui.Focus', 'pyjamas.ui.Event', 'pyjamas.ui.FocusListener', 'pyjamas.ui.KeyboardListener']
*/

/* start module: pyjamas.ui.FocusListener */
pyjamas.ui.FocusListener = $pyjs.loaded_modules["pyjamas.ui.FocusListener"] = function (__mod_name__) {
if(pyjamas.ui.FocusListener.__was_initialized__) return pyjamas.ui.FocusListener;
pyjamas.ui.FocusListener.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.FocusListener';
var __name__ = pyjamas.ui.FocusListener.__name__ = __mod_name__;
var FocusListener = pyjamas.ui.FocusListener;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.FocusListener');
pyjamas.ui.FocusListener.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjamas.ui.FocusListener.fireFocusEvent = function(listeners, sender, event) {
	var listener,type;
	type = pyjamas.ui.FocusListener.DOM.eventGetType(event);
	if (pyjslib.bool(pyjslib.eq(type, String('focus')))) {
		var __listener = listeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onFocus(sender);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	else if (pyjslib.bool(pyjslib.eq(type, String('blur')))) {
		var __listener = listeners.__iter__();
		try {
			while (true) {
				var listener = __listener.next();
				
				listener.onLostFocus(sender);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
	}
	return null;
};
pyjamas.ui.FocusListener.fireFocusEvent.__name__ = 'fireFocusEvent';

pyjamas.ui.FocusListener.fireFocusEvent.__bind_type__ = 0;
pyjamas.ui.FocusListener.fireFocusEvent.__args__ = [null,null,'listeners', 'sender', 'event'];
return this;
}; /* end pyjamas.ui.FocusListener */
$pyjs.modules_hash['pyjamas.ui.FocusListener'] = $pyjs.loaded_modules['pyjamas.ui.FocusListener'];


 /* end module: pyjamas.ui.FocusListener */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas']
*/

/* start module: pyjamas.ui.Grid */
pyjamas.ui.Grid = $pyjs.loaded_modules["pyjamas.ui.Grid"] = function (__mod_name__) {
if(pyjamas.ui.Grid.__was_initialized__) return pyjamas.ui.Grid;
pyjamas.ui.Grid.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Grid';
var __name__ = pyjamas.ui.Grid.__name__ = __mod_name__;
var Grid = pyjamas.ui.Grid;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.Grid');
pyjamas.ui.Grid.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.HTMLTable.HTMLTable', 'pyjamas.ui.pyjamas.ui.HTMLTable', 'pyjamas.ui.HTMLTable.HTMLTable', 'pyjamas.ui.HTMLTable'], 'pyjamas.ui.HTMLTable.HTMLTable', 'pyjamas.ui.Grid');
pyjamas.ui.Grid.HTMLTable = $pyjs.__modules__.pyjamas.ui.HTMLTable.HTMLTable;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.pyjamas.ui.CellFormatter', 'pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.CellFormatter'], 'pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.Grid');
pyjamas.ui.Grid.CellFormatter = $pyjs.__modules__.pyjamas.ui.CellFormatter.CellFormatter;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.pyjamas.ui.RowFormatter', 'pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.RowFormatter'], 'pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.Grid');
pyjamas.ui.Grid.RowFormatter = $pyjs.__modules__.pyjamas.ui.RowFormatter.RowFormatter;
pyjamas.ui.Grid.Grid = (function(){
	var cls_instance = pyjs__class_instance('Grid');
	var cls_definition = new Object();
	cls_definition.__md5__ = '06f9ceeb0e63327a412ada7b38cd15c2';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(rows, columns) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			rows = arguments[1];
			columns = arguments[2];
			var kwargs = arguments.length >= 4 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof columns != 'undefined') {
				if (pyjslib.get_pyjs_classtype(columns) == 'Dict') {
					kwargs = columns;
					columns = arguments[3];
				}
			} else 			if (typeof rows != 'undefined') {
				if (pyjslib.get_pyjs_classtype(rows) == 'Dict') {
					kwargs = rows;
					rows = arguments[3];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[3];
				}
			} else {
			}
		}
		if (typeof rows == 'undefined') rows=0;
		if (typeof columns == 'undefined') columns=0;

		self.numColumns = 0;
		self.numRows = 0;
		pyjs_kwargs_call(pyjamas.ui.Grid.HTMLTable, '__init__', null, kwargs, [{}, self]);
		if (pyjslib.bool(((pyjslib.cmp(rows, 0) == 1)) || ((pyjslib.cmp(columns, 0) == 1)))) {
			self.resize(rows, columns);
		}
		return null;
	}
	, 1, [null,'kwargs','self', 'rows', 'columns']);
	cls_definition.resize = pyjs__bind_method(cls_instance, 'resize', function(rows, columns) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			rows = arguments[1];
			columns = arguments[2];
		}

		self.resizeColumns(columns);
		self.resizeRows(rows);
		return null;
	}
	, 1, [null,null,'self', 'rows', 'columns']);
	cls_definition.resizeColumns = pyjs__bind_method(cls_instance, 'resizeColumns', function(columns) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			columns = arguments[1];
		}
		var i,j;
		if (pyjslib.bool(pyjslib.eq(self.numColumns, columns))) {
			return null;
		}
		if (pyjslib.bool((pyjslib.cmp(self.numColumns, columns) == 1))) {
			var __i = pyjslib.range(0, self.numRows).__iter__();
			try {
				while (true) {
					var i = __i.next();
					
					var __j = pyjslib.range( ( self.numColumns - 1 ) ,  ( columns - 1 ) , -1).__iter__();
					try {
						while (true) {
							var j = __j.next();
							
							self.removeCell(i, j);
						}
					} catch (e) {
						if (e.__name__ != 'StopIteration') {
							throw e;
						}
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else {
			var __i = pyjslib.range(self.numRows).__iter__();
			try {
				while (true) {
					var i = __i.next();
					
					var __j = pyjslib.range(self.numColumns, columns).__iter__();
					try {
						while (true) {
							var j = __j.next();
							
							self.insertCell(i, j);
						}
					} catch (e) {
						if (e.__name__ != 'StopIteration') {
							throw e;
						}
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		self.numColumns = columns;
		return null;
	}
	, 1, [null,null,'self', 'columns']);
	cls_definition.resizeRows = pyjs__bind_method(cls_instance, 'resizeRows', function(rows) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			rows = arguments[1];
		}

		if (pyjslib.bool(pyjslib.eq(self.numRows, rows))) {
			return null;
		}
		if (pyjslib.bool((pyjslib.cmp(self.numRows, rows) == -1))) {
			self.addRows(self.getBodyElement(),  ( rows - self.numRows ) , self.numColumns);
			self.numRows = rows;
		}
		else {
    while (pyjslib.bool((pyjslib.cmp(self.numRows, rows) == 1))) {
			self.numRows -= 1;
			self.removeRow(self.numRows);
    }
		}
		return null;
	}
	, 1, [null,null,'self', 'rows']);
	cls_definition.createCell = pyjs__bind_method(cls_instance, 'createCell', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var td;
		td = pyjamas.ui.Grid.HTMLTable.createCell(self);
		pyjamas.ui.Grid.DOM.setInnerHTML(td, String('\x26nbsp\x3B'));
		return td;
	}
	, 1, [null,null,'self']);
	cls_definition.clearCell = pyjs__bind_method(cls_instance, 'clearCell', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var b,td;
		td = self.cellFormatter.getElement(row, column);
		b = pyjamas.ui.Grid.HTMLTable.internalClearCell(self, td);
		pyjamas.ui.Grid.DOM.setInnerHTML(td, String('\x26nbsp\x3B'));
		return b;
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.prepareCell = pyjs__bind_method(cls_instance, 'prepareCell', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}

 		return null;
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.prepareRow = pyjs__bind_method(cls_instance, 'prepareRow', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}

 		return null;
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.getCellCount = pyjs__bind_method(cls_instance, 'getCellCount', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}

		return self.numColumns;
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.getColumnCount = pyjs__bind_method(cls_instance, 'getColumnCount', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.numColumns;
	}
	, 1, [null,null,'self']);
	cls_definition.getRowCount = pyjs__bind_method(cls_instance, 'getRowCount', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.numRows;
	}
	, 1, [null,null,'self']);
	cls_definition.addRows = pyjs__bind_method(cls_instance, 'addRows', function(table, numRows, columns) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			table = arguments[1];
			numRows = arguments[2];
			columns = arguments[3];
		}
		var cell,cellNum,td,rowNum,row;
		td = pyjamas.ui.Grid.DOM.createElement(String('td'));
		pyjamas.ui.Grid.DOM.setInnerHTML(td, String('\x26nbsp\x3B'));
		row = pyjamas.ui.Grid.DOM.createElement(String('tr'));
		var __cellNum = pyjslib.range(columns).__iter__();
		try {
			while (true) {
				var cellNum = __cellNum.next();
				
				cell = td.cloneNode(true);
				row.appendChild(cell);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		var __rowNum = pyjslib.range(numRows).__iter__();
		try {
			while (true) {
				var rowNum = __rowNum.next();
				
				table.appendChild(row.cloneNode(true));
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'table', 'numRows', 'columns']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.Grid.HTMLTable));
})();
return this;
}; /* end pyjamas.ui.Grid */
$pyjs.modules_hash['pyjamas.ui.Grid'] = $pyjs.loaded_modules['pyjamas.ui.Grid'];


 /* end module: pyjamas.ui.Grid */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.HTMLTable.HTMLTable', 'pyjamas.ui', 'pyjamas.ui.HTMLTable', 'pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.CellFormatter', 'pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.RowFormatter']
*/

/* start module: pyjamas.ui.HTMLTable */
pyjamas.ui.HTMLTable = $pyjs.loaded_modules["pyjamas.ui.HTMLTable"] = function (__mod_name__) {
if(pyjamas.ui.HTMLTable.__was_initialized__) return pyjamas.ui.HTMLTable;
pyjamas.ui.HTMLTable.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.HTMLTable';
var __name__ = pyjamas.ui.HTMLTable.__name__ = __mod_name__;
var HTMLTable = pyjamas.ui.HTMLTable;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.HTMLTable');
pyjamas.ui.HTMLTable.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Panel.Panel', 'pyjamas.ui.pyjamas.ui.Panel', 'pyjamas.ui.Panel.Panel', 'pyjamas.ui.Panel'], 'pyjamas.ui.Panel.Panel', 'pyjamas.ui.HTMLTable');
pyjamas.ui.HTMLTable.Panel = $pyjs.__modules__.pyjamas.ui.Panel.Panel;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.HTMLTable');
pyjamas.ui.HTMLTable.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.pyjamas.ui.CellFormatter', 'pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.CellFormatter'], 'pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.HTMLTable');
pyjamas.ui.HTMLTable.CellFormatter = $pyjs.__modules__.pyjamas.ui.CellFormatter.CellFormatter;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.pyjamas.ui.RowFormatter', 'pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.RowFormatter'], 'pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.HTMLTable');
pyjamas.ui.HTMLTable.RowFormatter = $pyjs.__modules__.pyjamas.ui.RowFormatter.RowFormatter;
pyjamas.ui.HTMLTable.widgethash = new pyjslib.Dict([]);
pyjamas.ui.HTMLTable.HTMLTable = (function(){
	var cls_instance = pyjs__class_instance('HTMLTable');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'b72d52d63d8782d45900e5e30cc7e1af';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		if (pyjslib.bool(!(kwargs.has_key(String('CellFormatter'))))) {
			kwargs.__setitem__(String('CellFormatter'), pyjamas.ui.HTMLTable.CellFormatter(self));
		}
		if (pyjslib.bool(!(kwargs.has_key(String('RowFormatter'))))) {
			kwargs.__setitem__(String('RowFormatter'), pyjamas.ui.HTMLTable.RowFormatter(self));
		}
		self.tableListeners = new pyjslib.List([]);
		self.widgetMap = new pyjslib.Dict([]);
		self.tableElem = pyjamas.ui.HTMLTable.DOM.createTable();
		self.bodyElem = pyjamas.ui.HTMLTable.DOM.createTBody();
		pyjamas.ui.HTMLTable.DOM.appendChild(self.tableElem, self.bodyElem);
		self.setElement(self.tableElem);
		self.sinkEvents(pyjamas.ui.HTMLTable.Event.ONCLICK);
		pyjs_kwargs_call(pyjamas.ui.HTMLTable.Panel, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.addTableListener = pyjs__bind_method(cls_instance, 'addTableListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.tableListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.clear = pyjs__bind_method(cls_instance, 'clear', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var child,col,row;
		var __row = pyjslib.range(self.getRowCount()).__iter__();
		try {
			while (true) {
				var row = __row.next();
				
				var __col = pyjslib.range(self.getCellCount(row)).__iter__();
				try {
					while (true) {
						var col = __col.next();
						
						child = self.getWidget(row, col);
						if (pyjslib.bool((child !== null))) {
							self.removeWidget(child);
						}
					}
				} catch (e) {
					if (e.__name__ != 'StopIteration') {
						throw e;
					}
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.clearCell = pyjs__bind_method(cls_instance, 'clearCell', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var td;
		td = self.cellFormatter.getElement(row, column);
		return self.internalClearCell(td);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.getCellCount = pyjs__bind_method(cls_instance, 'getCellCount', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}

		return 0;
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.getCellFormatter = pyjs__bind_method(cls_instance, 'getCellFormatter', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.cellFormatter;
	}
	, 1, [null,null,'self']);
	cls_definition.getCellPadding = pyjs__bind_method(cls_instance, 'getCellPadding', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.HTMLTable.DOM.getIntAttribute(self.tableElem, String('cellPadding'));
	}
	, 1, [null,null,'self']);
	cls_definition.getCellSpacing = pyjs__bind_method(cls_instance, 'getCellSpacing', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.HTMLTable.DOM.getIntAttribute(self.tableElem, String('cellSpacing'));
	}
	, 1, [null,null,'self']);
	cls_definition.getHTML = pyjs__bind_method(cls_instance, 'getHTML', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var element;
		element = self.cellFormatter.getElement(row, column);
		return pyjamas.ui.HTMLTable.DOM.getInnerHTML(element);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.getRowCount = pyjs__bind_method(cls_instance, 'getRowCount', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return 0;
	}
	, 1, [null,null,'self']);
	cls_definition.getRowFormatter = pyjs__bind_method(cls_instance, 'getRowFormatter', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.rowFormatter;
	}
	, 1, [null,null,'self']);
	cls_definition.getText = pyjs__bind_method(cls_instance, 'getText', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var element;
		self.checkCellBounds(row, column);
		element = self.cellFormatter.getElement(row, column);
		return pyjamas.ui.HTMLTable.DOM.getInnerText(element);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.getWidget = pyjs__bind_method(cls_instance, 'getWidget', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		if (typeof column == 'undefined') column=null;
		var key;
		if (pyjslib.bool((column === null))) {
			key = self.computeKeyForElement(row);
		}
		else {
			self.checkCellBounds(row, column);
			key = self.computeKey(row, column);
		}
		if (pyjslib.bool((key === null))) {
			return null;
		}
		return self.widgetMap.__getitem__(key);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.isCellPresent = pyjs__bind_method(cls_instance, 'isCellPresent', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}

		if (pyjslib.bool(((pyjslib.cmp(row, self.getRowCount()) != -1)) || ((pyjslib.cmp(row, 0) == -1)))) {
			return false;
		}
		if (pyjslib.bool(((pyjslib.cmp(column, 0) == -1)) || ((pyjslib.cmp(column, self.getCellCount(row)) != -1)))) {
			return false;
		}
		return true;
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.widgetMap.itervalues();
	}
	, 1, [null,null,'self']);
	cls_definition.onBrowserEvent = pyjs__bind_method(cls_instance, 'onBrowserEvent', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var body,column,tr,listener,td,row;
		if (pyjslib.bool(pyjslib.eq(pyjamas.ui.HTMLTable.DOM.eventGetType(event), String('click')))) {
			td = self.getEventTargetCell(event);
			if (pyjslib.bool(!(td))) {
				return null;
			}
			tr = pyjamas.ui.HTMLTable.DOM.getParent(td);
			body = pyjamas.ui.HTMLTable.DOM.getParent(tr);
			row = pyjamas.ui.HTMLTable.DOM.getChildIndex(body, tr);
			column = pyjamas.ui.HTMLTable.DOM.getChildIndex(tr, td);
			var __listener = self.tableListeners.__iter__();
			try {
				while (true) {
					var listener = __listener.next();
					
					if (pyjslib.bool(pyjslib.hasattr(listener, String('onCellClicked')))) {
						listener.onCellClicked(self, row, column);
					}
					else {
						listener(self);
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool(!pyjslib.eq(widget.getParent(), self))) {
			return false;
		}
		self.removeWidget(widget);
		return true;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.removeTableListener = pyjs__bind_method(cls_instance, 'removeTableListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.tableListeners.remove(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.setBorderWidth = pyjs__bind_method(cls_instance, 'setBorderWidth', function(width) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			width = arguments[1];
		}

		pyjamas.ui.HTMLTable.DOM.setAttribute(self.tableElem, String('border'), pyjslib.str(width));
		return null;
	}
	, 1, [null,null,'self', 'width']);
	cls_definition.setCellPadding = pyjs__bind_method(cls_instance, 'setCellPadding', function(padding) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			padding = arguments[1];
		}

		pyjamas.ui.HTMLTable.DOM.setAttribute(self.tableElem, String('cellPadding'), pyjslib.str(padding));
		return null;
	}
	, 1, [null,null,'self', 'padding']);
	cls_definition.setCellSpacing = pyjs__bind_method(cls_instance, 'setCellSpacing', function(spacing) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			spacing = arguments[1];
		}

		pyjamas.ui.HTMLTable.DOM.setAttribute(self.tableElem, String('cellSpacing'), pyjslib.str(spacing));
		return null;
	}
	, 1, [null,null,'self', 'spacing']);
	cls_definition.setHTML = pyjs__bind_method(cls_instance, 'setHTML', function(row, column, html) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			html = arguments[3];
		}
		var td;
		self.prepareCell(row, column);
		td = self.cleanCell(row, column);
		if (pyjslib.bool((html !== null))) {
			pyjamas.ui.HTMLTable.DOM.setInnerHTML(td, html);
		}
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'html']);
	cls_definition.setText = pyjs__bind_method(cls_instance, 'setText', function(row, column, text) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			text = arguments[3];
		}
		var td;
		self.prepareCell(row, column);
		td = self.cleanCell(row, column);
		if (pyjslib.bool((text !== null))) {
			pyjamas.ui.HTMLTable.DOM.setInnerText(td, text);
		}
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'text']);
	cls_definition.setWidget = pyjs__bind_method(cls_instance, 'setWidget', function(row, column, widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			widget = arguments[3];
		}
		var widget_hash,element,td;
		self.prepareCell(row, column);
		if (pyjslib.bool((widget === null))) {
			return null;
		}
		widget.removeFromParent();
		td = self.cleanCell(row, column);
		widget_hash = widget;
		element = widget.getElement();
		pyjamas.ui.HTMLTable.widgethash.__setitem__(element, widget_hash);
		self.widgetMap.__setitem__(widget_hash, widget);
		self.adopt(widget, td);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'widget']);
	cls_definition.cleanCell = pyjs__bind_method(cls_instance, 'cleanCell', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var td;
		td = self.cellFormatter.getRawElement(row, column);
		self.internalClearCell(td);
		return td;
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.computeKey = pyjs__bind_method(cls_instance, 'computeKey', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var element,child;
		element = self.cellFormatter.getRawElement(row, column);
		child = pyjamas.ui.HTMLTable.DOM.getFirstChild(element);
		if (pyjslib.bool((child === null))) {
			return null;
		}
		return self.computeKeyForElement(child);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.computeKeyForElement = pyjs__bind_method(cls_instance, 'computeKeyForElement', function(widgetElement) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widgetElement = arguments[1];
		}

		return pyjamas.ui.HTMLTable.widgethash.get(widgetElement);
	}
	, 1, [null,null,'self', 'widgetElement']);
	cls_definition.removeWidget = pyjs__bind_method(cls_instance, 'removeWidget', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}
		var element;
		self.disown(widget);
		element = widget.getElement();
    self.widgetMap.__delitem__(self.computeKeyForElement(element));
    pyjamas.ui.HTMLTable.widgethash.__delitem__(element);
		return true;
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.checkCellBounds = pyjs__bind_method(cls_instance, 'checkCellBounds', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var cellSize;
		self.checkRowBounds(row);
		cellSize = self.getCellCount(row);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.checkRowBounds = pyjs__bind_method(cls_instance, 'checkRowBounds', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}
		var rowSize;
		rowSize = self.getRowCount();
		return null;
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.createCell = pyjs__bind_method(cls_instance, 'createCell', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.HTMLTable.DOM.createTD();
	}
	, 1, [null,null,'self']);
	cls_definition.getBodyElement = pyjs__bind_method(cls_instance, 'getBodyElement', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.bodyElem;
	}
	, 1, [null,null,'self']);
	cls_definition.getDOMCellCount = pyjs__bind_method(cls_instance, 'getDOMCellCount', function(element, row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
			row = arguments[2];
		}
		if (typeof row == 'undefined') row=null;

		if (pyjslib.bool((row === null))) {
			return self.getDOMCellCountImpl(self.bodyElem, element);
		}
		return self.getDOMCellCountImpl(element, row);
	}
	, 1, [null,null,'self', 'element', 'row']);
	cls_definition.getDOMCellCountImpl = pyjs__bind_method(cls_instance, 'getDOMCellCountImpl', function(element, row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
			row = arguments[2];
		}

		return element.rows.item(row).cells.length;
	}
	, 1, [null,null,'self', 'element', 'row']);
	cls_definition.getDOMRowCount = pyjs__bind_method(cls_instance, 'getDOMRowCount', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
		}
		if (typeof element == 'undefined') element=null;

		if (pyjslib.bool((element === null))) {
			element = self.bodyElem;
		}
		return self.getDOMRowCountImpl(element);
	}
	, 1, [null,null,'self', 'element']);
	cls_definition.getDOMRowCountImpl = pyjs__bind_method(cls_instance, 'getDOMRowCountImpl', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
		}

		return element.rows.length;
	}
	, 1, [null,null,'self', 'element']);
	cls_definition.getEventTargetCell = pyjs__bind_method(cls_instance, 'getEventTargetCell', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var body,td,tr;
		td = pyjamas.ui.HTMLTable.DOM.eventGetTarget(event);
    while (pyjslib.bool((td !== null))) {
		if (pyjslib.bool(pyjslib.eq(pyjamas.ui.HTMLTable.DOM.getAttribute(td, String('tagName')).lower(), String('td')))) {
			tr = pyjamas.ui.HTMLTable.DOM.getParent(td);
			body = pyjamas.ui.HTMLTable.DOM.getParent(tr);
			if (pyjslib.bool(pyjamas.ui.HTMLTable.DOM.compare(body, self.bodyElem))) {
				return td;
			}
		}
		if (pyjslib.bool(pyjamas.ui.HTMLTable.DOM.compare(td, self.bodyElem))) {
			return null;
		}
		td = pyjamas.ui.HTMLTable.DOM.getParent(td);
    }
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition.insertCell = pyjs__bind_method(cls_instance, 'insertCell', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var tr,td;
		tr = self.rowFormatter.getRow(self.bodyElem, row);
		td = self.createCell();
		pyjamas.ui.HTMLTable.DOM.insertChild(tr, td, column);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.insertCells = pyjs__bind_method(cls_instance, 'insertCells', function(row, column, count) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			count = arguments[3];
		}
		var tr,i,td;
		tr = self.rowFormatter.getRow(self.bodyElem, row);
		var __i = pyjslib.range(column,  ( column + count ) ).__iter__();
		try {
			while (true) {
				var i = __i.next();
				
				td = self.createCell();
				pyjamas.ui.HTMLTable.DOM.insertChild(tr, td, i);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'count']);
	cls_definition.insertRow = pyjs__bind_method(cls_instance, 'insertRow', function(beforeRow) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			beforeRow = arguments[1];
		}
		var tr;
		if (pyjslib.bool(!pyjslib.eq(beforeRow, self.getRowCount()))) {
			self.checkRowBounds(beforeRow);
		}
		tr = pyjamas.ui.HTMLTable.DOM.createTR();
		pyjamas.ui.HTMLTable.DOM.insertChild(self.bodyElem, tr, beforeRow);
		return beforeRow;
	}
	, 1, [null,null,'self', 'beforeRow']);
	cls_definition.internalClearCell = pyjs__bind_method(cls_instance, 'internalClearCell', function(td) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			td = arguments[1];
		}
		var widget,maybeChild;
		maybeChild = pyjamas.ui.HTMLTable.DOM.getFirstChild(td);
		widget = null;
		if (pyjslib.bool((maybeChild !== null))) {
			widget = self.getWidget(maybeChild);
		}
		if (pyjslib.bool((widget !== null))) {
			self.removeWidget(widget);
			return true;
		}
		pyjamas.ui.HTMLTable.DOM.setInnerHTML(td, String(''));
		return false;
	}
	, 1, [null,null,'self', 'td']);
	cls_definition.prepareCell = pyjs__bind_method(cls_instance, 'prepareCell', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}

 		return null;
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.prepareRow = pyjs__bind_method(cls_instance, 'prepareRow', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}

 		return null;
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.removeCell = pyjs__bind_method(cls_instance, 'removeCell', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var tr,td;
		self.checkCellBounds(row, column);
		td = self.cleanCell(row, column);
		tr = self.rowFormatter.getRow(self.bodyElem, row);
		pyjamas.ui.HTMLTable.DOM.removeChild(tr, td);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.removeRow = pyjs__bind_method(cls_instance, 'removeRow', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}
		var column;
		var __column = pyjslib.range(self.getCellCount(row)).__iter__();
		try {
			while (true) {
				var column = __column.next();
				
				self.cleanCell(row, column);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		pyjamas.ui.HTMLTable.DOM.removeChild(self.bodyElem, self.rowFormatter.getRow(self.bodyElem, row));
		return null;
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.setCellFormatter = pyjs__bind_method(cls_instance, 'setCellFormatter', function(cellFormatter) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			cellFormatter = arguments[1];
		}

		self.cellFormatter = cellFormatter;
		return null;
	}
	, 1, [null,null,'self', 'cellFormatter']);
	cls_definition.setRowFormatter = pyjs__bind_method(cls_instance, 'setRowFormatter', function(rowFormatter) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			rowFormatter = arguments[1];
		}

		self.rowFormatter = rowFormatter;
		return null;
	}
	, 1, [null,null,'self', 'rowFormatter']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.HTMLTable.Panel));
})();
return this;
}; /* end pyjamas.ui.HTMLTable */
$pyjs.modules_hash['pyjamas.ui.HTMLTable'] = $pyjs.loaded_modules['pyjamas.ui.HTMLTable'];


 /* end module: pyjamas.ui.HTMLTable */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Panel.Panel', 'pyjamas.ui', 'pyjamas.ui.Panel', 'pyjamas.ui.Event', 'pyjamas.ui.CellFormatter.CellFormatter', 'pyjamas.ui.CellFormatter', 'pyjamas.ui.RowFormatter.RowFormatter', 'pyjamas.ui.RowFormatter']
*/

/* start module: pyjamas.ui.CellFormatter */
pyjamas.ui.CellFormatter = $pyjs.loaded_modules["pyjamas.ui.CellFormatter"] = function (__mod_name__) {
if(pyjamas.ui.CellFormatter.__was_initialized__) return pyjamas.ui.CellFormatter;
pyjamas.ui.CellFormatter.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.CellFormatter';
var __name__ = pyjamas.ui.CellFormatter.__name__ = __mod_name__;
var CellFormatter = pyjamas.ui.CellFormatter;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.CellFormatter');
pyjamas.ui.CellFormatter.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Applier', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Applier', 'pyjamas.ui'], 'pyjamas.ui.Applier', 'pyjamas.ui.CellFormatter');
pyjamas.ui.CellFormatter.Applier = $pyjs.__modules__.pyjamas.ui.Applier;
pyjamas.ui.CellFormatter.CellFormatter = (function(){
	var cls_instance = pyjs__class_instance('CellFormatter');
	var cls_definition = new Object();
	cls_definition.__md5__ = '32d2f0d0d0e0015afb7ed681fd595e2c';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(outer) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			outer = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof outer != 'undefined') {
				if (pyjslib.get_pyjs_classtype(outer) == 'Dict') {
					kwargs = outer;
					outer = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}

		self.outer = outer;
		pyjs_kwargs_call(pyjamas.ui.CellFormatter.Applier, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self', 'outer']);
	cls_definition.addStyleName = pyjs__bind_method(cls_instance, 'addStyleName', function(row, column, styleName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			styleName = arguments[3];
		}

		self.outer.prepareCell(row, column);
		self.outer.setStyleName(self.getElement(row, column), styleName, true);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'styleName']);
	cls_definition.getElement = pyjs__bind_method(cls_instance, 'getElement', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}

		self.outer.checkCellBounds(row, column);
		return pyjamas.ui.CellFormatter.DOM.getChild(self.outer.rowFormatter.getRow(self.outer.bodyElem, row), column);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.getStyleName = pyjs__bind_method(cls_instance, 'getStyleName', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}

		return pyjamas.ui.CellFormatter.DOM.getAttribute(self.getElement(row, column), String('className'));
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.isVisible = pyjs__bind_method(cls_instance, 'isVisible', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}
		var element;
		element = self.getElement(row, column);
		return self.outer.isVisible(element);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.removeStyleName = pyjs__bind_method(cls_instance, 'removeStyleName', function(row, column, styleName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			styleName = arguments[3];
		}

		self.outer.checkCellBounds(row, column);
		self.outer.setStyleName(self.getElement(row, column), styleName, false);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'styleName']);
	cls_definition.setAlignment = pyjs__bind_method(cls_instance, 'setAlignment', function(row, column, hAlign, vAlign) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			hAlign = arguments[3];
			vAlign = arguments[4];
		}

		self.setHorizontalAlignment(row, column, hAlign);
		self.setVerticalAlignment(row, column, vAlign);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'hAlign', 'vAlign']);
	cls_definition.setHeight = pyjs__bind_method(cls_instance, 'setHeight', function(row, column, height) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			height = arguments[3];
		}
		var element;
		self.outer.prepareCell(row, column);
		element = self.getCellElement(self.outer.bodyElem, row, column);
		pyjamas.ui.CellFormatter.DOM.setStyleAttribute(element, String('height'), height);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'height']);
	cls_definition.setHorizontalAlignment = pyjs__bind_method(cls_instance, 'setHorizontalAlignment', function(row, column, align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			align = arguments[3];
		}
		var element;
		self.outer.prepareCell(row, column);
		element = self.getCellElement(self.outer.bodyElem, row, column);
		pyjamas.ui.CellFormatter.DOM.setAttribute(element, String('align'), align);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'align']);
	cls_definition.setStyleName = pyjs__bind_method(cls_instance, 'setStyleName', function(row, column, styleName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			styleName = arguments[3];
		}

		self.outer.prepareCell(row, column);
		self.setAttr(row, column, String('className'), styleName);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'styleName']);
	cls_definition.setVerticalAlignment = pyjs__bind_method(cls_instance, 'setVerticalAlignment', function(row, column, align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			align = arguments[3];
		}

		self.outer.prepareCell(row, column);
		pyjamas.ui.CellFormatter.DOM.setStyleAttribute(self.getCellElement(self.outer.bodyElem, row, column), String('verticalAlign'), align);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'align']);
	cls_definition.setVisible = pyjs__bind_method(cls_instance, 'setVisible', function(row, column, visible) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			visible = arguments[3];
		}
		var element;
		element = self.ensureElement(row, column);
		self.outer.setVisible(element, visible);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'visible']);
	cls_definition.setWidth = pyjs__bind_method(cls_instance, 'setWidth', function(row, column, width) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			width = arguments[3];
		}

		self.outer.prepareCell(row, column);
		pyjamas.ui.CellFormatter.DOM.setStyleAttribute(self.getCellElement(self.outer.bodyElem, row, column), String('width'), width);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'width']);
	cls_definition.setWordWrap = pyjs__bind_method(cls_instance, 'setWordWrap', function(row, column, wrap) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			wrap = arguments[3];
		}
		var wrap_str;
		self.outer.prepareCell(row, column);
		if (pyjslib.bool(wrap)) {
			wrap_str = String('');
		}
		else {
			wrap_str = String('nowrap');
		}
		pyjamas.ui.CellFormatter.DOM.setStyleAttribute(self.getElement(row, column), String('whiteSpace'), wrap_str);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'wrap']);
	cls_definition.getCellElement = pyjs__bind_method(cls_instance, 'getCellElement', function(table, row, col) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			table = arguments[1];
			row = arguments[2];
			col = arguments[3];
		}
		var cols,item,length;
		length = table.rows.length;
		if (pyjslib.bool((pyjslib.cmp(row, length) != -1))) {
			return null;
		}
		cols = table.rows.item(row).cells;
		length = cols.length;
		if (pyjslib.bool((pyjslib.cmp(col, length) != -1))) {
			return null;
		}
		item = cols.item(col);
		return item;
	}
	, 1, [null,null,'self', 'table', 'row', 'col']);
	cls_definition.getRawElement = pyjs__bind_method(cls_instance, 'getRawElement', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}

		return self.getCellElement(self.outer.bodyElem, row, column);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.ensureElement = pyjs__bind_method(cls_instance, 'ensureElement', function(row, column) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
		}

		self.outer.prepareCell(row, column);
		return pyjamas.ui.CellFormatter.DOM.getChild(self.outer.rowFormatter.ensureElement(row), column);
	}
	, 1, [null,null,'self', 'row', 'column']);
	cls_definition.getStyleAttr = pyjs__bind_method(cls_instance, 'getStyleAttr', function(row, column, attr) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			attr = arguments[3];
		}
		var elem;
		elem = self.getElement(row, column);
		return pyjamas.ui.CellFormatter.DOM.getStyleAttribute(elem, attr);
	}
	, 1, [null,null,'self', 'row', 'column', 'attr']);
	cls_definition.setStyleAttr = pyjs__bind_method(cls_instance, 'setStyleAttr', function(row, column, attrName, value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			attrName = arguments[3];
			value = arguments[4];
		}
		var elem;
		elem = self.getElement(row, column);
		pyjamas.ui.CellFormatter.DOM.setStyleAttribute(elem, attrName, value);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'attrName', 'value']);
	cls_definition.getAttr = pyjs__bind_method(cls_instance, 'getAttr', function(row, column, attr) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			attr = arguments[3];
		}
		var elem;
		elem = self.getElement(row, column);
		return pyjamas.ui.CellFormatter.DOM.getAttribute(elem, attr);
	}
	, 1, [null,null,'self', 'row', 'column', 'attr']);
	cls_definition.setAttr = pyjs__bind_method(cls_instance, 'setAttr', function(row, column, attrName, value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			column = arguments[2];
			attrName = arguments[3];
			value = arguments[4];
		}
		var elem;
		elem = self.getElement(row, column);
		pyjamas.ui.CellFormatter.DOM.setAttribute(elem, attrName, value);
		return null;
	}
	, 1, [null,null,'self', 'row', 'column', 'attrName', 'value']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.CellFormatter.Applier));
})();
return this;
}; /* end pyjamas.ui.CellFormatter */
$pyjs.modules_hash['pyjamas.ui.CellFormatter'] = $pyjs.loaded_modules['pyjamas.ui.CellFormatter'];


 /* end module: pyjamas.ui.CellFormatter */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Applier', 'pyjamas.ui']
*/

/* start module: pyjamas.ui.RowFormatter */
pyjamas.ui.RowFormatter = $pyjs.loaded_modules["pyjamas.ui.RowFormatter"] = function (__mod_name__) {
if(pyjamas.ui.RowFormatter.__was_initialized__) return pyjamas.ui.RowFormatter;
pyjamas.ui.RowFormatter.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.RowFormatter';
var __name__ = pyjamas.ui.RowFormatter.__name__ = __mod_name__;
var RowFormatter = pyjamas.ui.RowFormatter;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.RowFormatter');
pyjamas.ui.RowFormatter.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Applier', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Applier', 'pyjamas.ui'], 'pyjamas.ui.Applier', 'pyjamas.ui.RowFormatter');
pyjamas.ui.RowFormatter.Applier = $pyjs.__modules__.pyjamas.ui.Applier;
pyjamas.ui.RowFormatter.RowFormatter = (function(){
	var cls_instance = pyjs__class_instance('RowFormatter');
	var cls_definition = new Object();
	cls_definition.__md5__ = '9f6154cea53011ce4b6f2880f97ac973';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(outer) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			outer = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof outer != 'undefined') {
				if (pyjslib.get_pyjs_classtype(outer) == 'Dict') {
					kwargs = outer;
					outer = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}

		self.outer = outer;
		pyjs_kwargs_call(pyjamas.ui.RowFormatter.Applier, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self', 'outer']);
	cls_definition.addStyleName = pyjs__bind_method(cls_instance, 'addStyleName', function(row, styleName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			styleName = arguments[2];
		}

		self.outer.setStyleName(self.ensureElement(row), styleName, true);
		return null;
	}
	, 1, [null,null,'self', 'row', 'styleName']);
	cls_definition.getElement = pyjs__bind_method(cls_instance, 'getElement', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}

		self.outer.checkRowBounds(row);
		return self.getRow(self.outer.bodyElem, row);
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.getStyleName = pyjs__bind_method(cls_instance, 'getStyleName', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}

		return pyjamas.ui.RowFormatter.DOM.getAttribute(self.getElement(row), String('className'));
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.isVisible = pyjs__bind_method(cls_instance, 'isVisible', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}
		var element;
		element = self.getElement(row);
		return self.outer.isVisible(element);
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.removeStyleName = pyjs__bind_method(cls_instance, 'removeStyleName', function(row, styleName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			styleName = arguments[2];
		}

		self.outer.setStyleName(self.getElement(row), styleName, false);
		return null;
	}
	, 1, [null,null,'self', 'row', 'styleName']);
	cls_definition.setStyleName = pyjs__bind_method(cls_instance, 'setStyleName', function(row, styleName) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			styleName = arguments[2];
		}
		var elem;
		elem = self.ensureElement(row);
		pyjamas.ui.RowFormatter.DOM.setAttribute(elem, String('className'), styleName);
		return null;
	}
	, 1, [null,null,'self', 'row', 'styleName']);
	cls_definition.setVerticalAlign = pyjs__bind_method(cls_instance, 'setVerticalAlign', function(row, align) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			align = arguments[2];
		}

		pyjamas.ui.RowFormatter.DOM.setStyleAttribute(self.ensureElement(row), String('verticalAlign'), align);
		return null;
	}
	, 1, [null,null,'self', 'row', 'align']);
	cls_definition.setVisible = pyjs__bind_method(cls_instance, 'setVisible', function(row, visible) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			visible = arguments[2];
		}
		var element;
		element = self.ensureElement(row);
		self.outer.setVisible(element, visible);
		return null;
	}
	, 1, [null,null,'self', 'row', 'visible']);
	cls_definition.ensureElement = pyjs__bind_method(cls_instance, 'ensureElement', function(row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
		}

		self.outer.prepareRow(row);
		return self.getRow(self.outer.bodyElem, row);
	}
	, 1, [null,null,'self', 'row']);
	cls_definition.getRow = pyjs__bind_method(cls_instance, 'getRow', function(element, row) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
			row = arguments[2];
		}

		return element.rows.item(row);
	}
	, 1, [null,null,'self', 'element', 'row']);
	cls_definition.setStyleAttr = pyjs__bind_method(cls_instance, 'setStyleAttr', function(row, attrName, value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			attrName = arguments[2];
			value = arguments[3];
		}
		var element;
		element = self.ensureElement(row);
		pyjamas.ui.RowFormatter.DOM.setStyleAttribute(element, attrName, value);
		return null;
	}
	, 1, [null,null,'self', 'row', 'attrName', 'value']);
	cls_definition.setAttr = pyjs__bind_method(cls_instance, 'setAttr', function(row, attrName, value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			row = arguments[1];
			attrName = arguments[2];
			value = arguments[3];
		}
		var element;
		element = self.ensureElement(row);
		pyjamas.ui.RowFormatter.DOM.setAttribute(element, attrName, value);
		return null;
	}
	, 1, [null,null,'self', 'row', 'attrName', 'value']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.RowFormatter.Applier));
})();
return this;
}; /* end pyjamas.ui.RowFormatter */
$pyjs.modules_hash['pyjamas.ui.RowFormatter'] = $pyjs.loaded_modules['pyjamas.ui.RowFormatter'];


 /* end module: pyjamas.ui.RowFormatter */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Applier', 'pyjamas.ui']
*/

/* start module: pyjamas.ui.CheckBox */
pyjamas.ui.CheckBox = $pyjs.loaded_modules["pyjamas.ui.CheckBox"] = function (__mod_name__) {
if(pyjamas.ui.CheckBox.__was_initialized__) return pyjamas.ui.CheckBox;
pyjamas.ui.CheckBox.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.CheckBox';
var __name__ = pyjamas.ui.CheckBox.__name__ = __mod_name__;
var CheckBox = pyjamas.ui.CheckBox;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.CheckBox');
pyjamas.ui.CheckBox.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.ButtonBase.ButtonBase', 'pyjamas.ui.pyjamas.ui.ButtonBase', 'pyjamas.ui.ButtonBase.ButtonBase', 'pyjamas.ui.ButtonBase'], 'pyjamas.ui.ButtonBase.ButtonBase', 'pyjamas.ui.CheckBox');
pyjamas.ui.CheckBox.ButtonBase = $pyjs.__modules__.pyjamas.ui.ButtonBase.ButtonBase;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.CheckBox');
pyjamas.ui.CheckBox.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjamas.ui.CheckBox._CheckBox_unique_id = 0;
pyjamas.ui.CheckBox.CheckBox = (function(){
	var cls_instance = pyjs__class_instance('CheckBox');
	var cls_definition = new Object();
	cls_definition.__md5__ = '871aa81518004940c76eaae41cf7e0a2';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(label, asHTML) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			label = arguments[1];
			asHTML = arguments[2];
			var kwargs = arguments.length >= 4 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof asHTML != 'undefined') {
				if (pyjslib.get_pyjs_classtype(asHTML) == 'Dict') {
					kwargs = asHTML;
					asHTML = arguments[3];
				}
			} else 			if (typeof label != 'undefined') {
				if (pyjslib.get_pyjs_classtype(label) == 'Dict') {
					kwargs = label;
					label = arguments[3];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[3];
				}
			} else {
			}
		}
		if (typeof label == 'undefined') label=null;
		if (typeof asHTML == 'undefined') asHTML=false;

		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), String('gwt-CheckBox'));
		}
		if (pyjslib.bool(label)) {
			if (pyjslib.bool(asHTML)) {
				kwargs.__setitem__(String('HTML'), label);
			}
			else {
				kwargs.__setitem__(String('Text'), label);
			}
		}
		pyjs_kwargs_call(self, 'initElement', null, kwargs, [{}, pyjamas.ui.CheckBox.DOM.createInputCheck()]);
		return null;
	}
	, 1, [null,'kwargs','self', 'label', 'asHTML']);
	cls_definition.initElement = pyjs__bind_method(cls_instance, 'initElement', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			element = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof element != 'undefined') {
				if (pyjslib.get_pyjs_classtype(element) == 'Dict') {
					kwargs = element;
					element = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}
		var uid;
		self.inputElem = element;
		self.labelElem = pyjamas.ui.CheckBox.DOM.createLabel();
		pyjs_kwargs_call(pyjamas.ui.CheckBox.ButtonBase, '__init__', null, kwargs, [{}, self, pyjamas.ui.CheckBox.DOM.createSpan()]);
		self.unsinkEvents(((pyjamas.ui.CheckBox.Event.FOCUSEVENTS | pyjamas.ui.CheckBox.Event.ONCLICK)));
		pyjamas.ui.CheckBox.DOM.sinkEvents(self.inputElem, ((pyjamas.ui.CheckBox.Event.FOCUSEVENTS | pyjamas.ui.CheckBox.Event.ONCLICK | pyjamas.ui.CheckBox.DOM.getEventsSunk(self.inputElem))));
		pyjamas.ui.CheckBox.DOM.appendChild(self.getElement(), self.inputElem);
		pyjamas.ui.CheckBox.DOM.appendChild(self.getElement(), self.labelElem);
		uid = pyjslib.sprintf(String('check%d'), self.getUniqueID());
		pyjamas.ui.CheckBox.DOM.setAttribute(self.inputElem, String('id'), uid);
		pyjamas.ui.CheckBox.DOM.setAttribute(self.labelElem, String('htmlFor'), uid);
		return null;
	}
	, 1, [null,'kwargs','self', 'element']);
	cls_definition.getUniqueID = pyjs__bind_method(cls_instance, 'getUniqueID', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		pyjamas.ui.CheckBox._CheckBox_unique_id += 1;
		return pyjamas.ui.CheckBox._CheckBox_unique_id;
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.getHTML = pyjs__bind_method(cls_instance, 'getHTML', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.CheckBox.DOM.getInnerHTML(self.labelElem);
	}
	, 1, [null,null,'self']);
	cls_definition.getName = pyjs__bind_method(cls_instance, 'getName', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.CheckBox.DOM.getAttribute(self.inputElem, String('name'));
	}
	, 1, [null,null,'self']);
	cls_definition.getText = pyjs__bind_method(cls_instance, 'getText', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.CheckBox.DOM.getInnerText(self.labelElem);
	}
	, 1, [null,null,'self']);
	cls_definition.setChecked = pyjs__bind_method(cls_instance, 'setChecked', function(checked) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			checked = arguments[1];
		}

		pyjamas.ui.CheckBox.DOM.setBooleanAttribute(self.inputElem, String('checked'), checked);
		pyjamas.ui.CheckBox.DOM.setBooleanAttribute(self.inputElem, String('defaultChecked'), checked);
		return null;
	}
	, 1, [null,null,'self', 'checked']);
	cls_definition.isChecked = pyjs__bind_method(cls_instance, 'isChecked', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var propName;
		if (pyjslib.bool(self.isAttached())) {
			propName = String('checked');
		}
		else {
			propName = String('defaultChecked');
		}
		return pyjamas.ui.CheckBox.DOM.getBooleanAttribute(self.inputElem, propName);
	}
	, 1, [null,null,'self']);
	cls_definition.isEnabled = pyjs__bind_method(cls_instance, 'isEnabled', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return !(pyjamas.ui.CheckBox.DOM.getBooleanAttribute(self.inputElem, String('disabled')));
	}
	, 1, [null,null,'self']);
	cls_definition.setEnabled = pyjs__bind_method(cls_instance, 'setEnabled', function(enabled) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			enabled = arguments[1];
		}

		pyjamas.ui.CheckBox.DOM.setBooleanAttribute(self.inputElem, String('disabled'), !(enabled));
		return null;
	}
	, 1, [null,null,'self', 'enabled']);
	cls_definition.setFocus = pyjs__bind_method(cls_instance, 'setFocus', function() {
		if (this.__is_instance__ === true) {
			var focused = this;
		} else {
			var focused = arguments[0];
		}

		if (pyjslib.bool(focused)) {
			pyjamas.ui.CheckBox.Focus.focus(pyjamas.ui.CheckBox.self.inputElem);
		}
		else {
			pyjamas.ui.CheckBox.Focus.blur(pyjamas.ui.CheckBox.self.inputElem);
		}
		return null;
	}
	, 1, [null,null,'focused']);
	cls_definition.setHTML = pyjs__bind_method(cls_instance, 'setHTML', function(html) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			html = arguments[1];
		}

		pyjamas.ui.CheckBox.DOM.setInnerHTML(self.labelElem, html);
		return null;
	}
	, 1, [null,null,'self', 'html']);
	cls_definition.setName = pyjs__bind_method(cls_instance, 'setName', function(name) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			name = arguments[1];
		}

		pyjamas.ui.CheckBox.DOM.setAttribute(self.inputElem, String('name'), name);
		return null;
	}
	, 1, [null,null,'self', 'name']);
	cls_definition.setTabIndex = pyjs__bind_method(cls_instance, 'setTabIndex', function(index) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			index = arguments[1];
		}

		pyjamas.ui.CheckBox.Focus.setTabIndex(self.inputElem, index);
		return null;
	}
	, 1, [null,null,'self', 'index']);
	cls_definition.setText = pyjs__bind_method(cls_instance, 'setText', function(text) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			text = arguments[1];
		}

		pyjamas.ui.CheckBox.DOM.setInnerText(self.labelElem, text);
		return null;
	}
	, 1, [null,null,'self', 'text']);
	cls_definition.onDetach = pyjs__bind_method(cls_instance, 'onDetach', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.setChecked(self.isChecked());
		pyjamas.ui.CheckBox.ButtonBase.onDetach(self);
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.CheckBox.ButtonBase));
})();
return this;
}; /* end pyjamas.ui.CheckBox */
$pyjs.modules_hash['pyjamas.ui.CheckBox'] = $pyjs.loaded_modules['pyjamas.ui.CheckBox'];


 /* end module: pyjamas.ui.CheckBox */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.ButtonBase.ButtonBase', 'pyjamas.ui', 'pyjamas.ui.ButtonBase', 'pyjamas.ui.Event']
*/

/* start module: pyjamas.ui.AbsolutePanel */
pyjamas.ui.AbsolutePanel = $pyjs.loaded_modules["pyjamas.ui.AbsolutePanel"] = function (__mod_name__) {
if(pyjamas.ui.AbsolutePanel.__was_initialized__) return pyjamas.ui.AbsolutePanel;
pyjamas.ui.AbsolutePanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.AbsolutePanel';
var __name__ = pyjamas.ui.AbsolutePanel.__name__ = __mod_name__;
var AbsolutePanel = pyjamas.ui.AbsolutePanel;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.AbsolutePanel');
pyjamas.ui.AbsolutePanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.pyjamas.ui.ComplexPanel', 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.ComplexPanel'], 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui.AbsolutePanel');
pyjamas.ui.AbsolutePanel.ComplexPanel = $pyjs.__modules__.pyjamas.ui.ComplexPanel.ComplexPanel;
pyjamas.ui.AbsolutePanel.AbsolutePanel = (function(){
	var cls_instance = pyjs__class_instance('AbsolutePanel');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'b39ad9087e118e428381f1e9fa57412b';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 1 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[1];
				}
			} else {
			}
		}

		self.setElement(pyjamas.ui.AbsolutePanel.DOM.createDiv());
		pyjamas.ui.AbsolutePanel.DOM.setStyleAttribute(self.getElement(), String('position'), String('relative'));
		pyjamas.ui.AbsolutePanel.DOM.setStyleAttribute(self.getElement(), String('overflow'), String('hidden'));
		pyjs_kwargs_call(pyjamas.ui.AbsolutePanel.ComplexPanel, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(widget, left, top) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			left = arguments[2];
			top = arguments[3];
		}
		if (typeof left == 'undefined') left=null;
		if (typeof top == 'undefined') top=null;

		pyjamas.ui.AbsolutePanel.ComplexPanel.add(self, widget, self.getElement());
		if (pyjslib.bool((left !== null))) {
			self.setWidgetPosition(widget, left, top);
		}
		return null;
	}
	, 1, [null,null,'self', 'widget', 'left', 'top']);
	cls_definition.setWidgetPosition = pyjs__bind_method(cls_instance, 'setWidgetPosition', function(widget, left, top) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			left = arguments[2];
			top = arguments[3];
		}
		var h;
		self.checkWidgetParent(widget);
		h = widget.getElement();
		if (pyjslib.bool((pyjslib.eq(left, -1)) && (pyjslib.eq(top, -1)))) {
			pyjamas.ui.AbsolutePanel.DOM.setStyleAttribute(h, String('left'), String(''));
			pyjamas.ui.AbsolutePanel.DOM.setStyleAttribute(h, String('top'), String(''));
			pyjamas.ui.AbsolutePanel.DOM.setStyleAttribute(h, String('position'), String('static'));
		}
		else {
			pyjamas.ui.AbsolutePanel.DOM.setStyleAttribute(h, String('position'), String('absolute'));
			pyjamas.ui.AbsolutePanel.DOM.setStyleAttribute(h, String('left'), pyjslib.sprintf(String('%dpx'), left));
			pyjamas.ui.AbsolutePanel.DOM.setStyleAttribute(h, String('top'), pyjslib.sprintf(String('%dpx'), top));
		}
		return null;
	}
	, 1, [null,null,'self', 'widget', 'left', 'top']);
	cls_definition.getWidgetLeft = pyjs__bind_method(cls_instance, 'getWidgetLeft', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		self.checkWidgetParent(widget);
		return pyjamas.ui.AbsolutePanel.DOM.getIntAttribute(widget.getElement(), String('offsetLeft'));
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.getWidgetTop = pyjs__bind_method(cls_instance, 'getWidgetTop', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		self.checkWidgetParent(widget);
		return pyjamas.ui.AbsolutePanel.DOM.getIntAttribute(widget.getElement(), String('offsetTop'));
	}
	, 1, [null,null,'self', 'widget']);
	cls_definition.checkWidgetParent = pyjs__bind_method(cls_instance, 'checkWidgetParent', function(widget) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
		}

		if (pyjslib.bool(!pyjslib.eq(widget.getParent(), self))) {
			console.error(String('Widget must be a child of this panel.'));
		}
		return null;
	}
	, 1, [null,null,'self', 'widget']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.AbsolutePanel.ComplexPanel));
})();
return this;
}; /* end pyjamas.ui.AbsolutePanel */
$pyjs.modules_hash['pyjamas.ui.AbsolutePanel'] = $pyjs.loaded_modules['pyjamas.ui.AbsolutePanel'];


 /* end module: pyjamas.ui.AbsolutePanel */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.ComplexPanel.ComplexPanel', 'pyjamas.ui', 'pyjamas.ui.ComplexPanel']
*/

/* start module: pyjamas.ui.RadioButton */
pyjamas.ui.RadioButton = $pyjs.loaded_modules["pyjamas.ui.RadioButton"] = function (__mod_name__) {
if(pyjamas.ui.RadioButton.__was_initialized__) return pyjamas.ui.RadioButton;
pyjamas.ui.RadioButton.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.RadioButton';
var __name__ = pyjamas.ui.RadioButton.__name__ = __mod_name__;
var RadioButton = pyjamas.ui.RadioButton;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.RadioButton');
pyjamas.ui.RadioButton.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.CheckBox.CheckBox', 'pyjamas.ui.pyjamas.ui.CheckBox', 'pyjamas.ui.CheckBox.CheckBox', 'pyjamas.ui.CheckBox'], 'pyjamas.ui.CheckBox.CheckBox', 'pyjamas.ui.RadioButton');
pyjamas.ui.RadioButton.CheckBox = $pyjs.__modules__.pyjamas.ui.CheckBox.CheckBox;
pyjamas.ui.RadioButton.RadioButton = (function(){
	var cls_instance = pyjs__class_instance('RadioButton');
	var cls_definition = new Object();
	cls_definition.__md5__ = '2f052e106944f85231b9f56c5e03ba53';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(group, label, asHTML) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 4 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			group = arguments[1];
			label = arguments[2];
			asHTML = arguments[3];
			var kwargs = arguments.length >= 5 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof asHTML != 'undefined') {
				if (pyjslib.get_pyjs_classtype(asHTML) == 'Dict') {
					kwargs = asHTML;
					asHTML = arguments[4];
				}
			} else 			if (typeof label != 'undefined') {
				if (pyjslib.get_pyjs_classtype(label) == 'Dict') {
					kwargs = label;
					label = arguments[4];
				}
			} else 			if (typeof group != 'undefined') {
				if (pyjslib.get_pyjs_classtype(group) == 'Dict') {
					kwargs = group;
					group = arguments[4];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[4];
				}
			} else {
			}
		}
		if (typeof label == 'undefined') label=null;
		if (typeof asHTML == 'undefined') asHTML=false;

		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), String('gwt-RadioButton'));
		}
		if (pyjslib.bool(label)) {
			if (pyjslib.bool(asHTML)) {
				kwargs.__setitem__(String('HTML'), label);
			}
			else {
				kwargs.__setitem__(String('Text'), label);
			}
		}
		pyjs_kwargs_call(self, 'initElement', null, kwargs, [{}, pyjamas.ui.RadioButton.DOM.createInputRadio(group)]);
		return null;
	}
	, 1, [null,'kwargs','self', 'group', 'label', 'asHTML']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.RadioButton.CheckBox));
})();
return this;
}; /* end pyjamas.ui.RadioButton */
$pyjs.modules_hash['pyjamas.ui.RadioButton'] = $pyjs.loaded_modules['pyjamas.ui.RadioButton'];


 /* end module: pyjamas.ui.RadioButton */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.CheckBox.CheckBox', 'pyjamas.ui', 'pyjamas.ui.CheckBox']
*/

/* start module: pyjamas.ui.Image */
pyjamas.ui.Image = $pyjs.loaded_modules["pyjamas.ui.Image"] = function (__mod_name__) {
if(pyjamas.ui.Image.__was_initialized__) return pyjamas.ui.Image;
pyjamas.ui.Image.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.Image';
var __name__ = pyjamas.ui.Image.__name__ = __mod_name__;
var Image = pyjamas.ui.Image;

pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.Image');
pyjamas.ui.Image.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Widget.Widget', 'pyjamas.ui.pyjamas.ui.Widget', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Widget'], 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Image');
pyjamas.ui.Image.Widget = $pyjs.__modules__.pyjamas.ui.Widget.Widget;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.Event', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.Event', 'pyjamas.ui'], 'pyjamas.ui.Event', 'pyjamas.ui.Image');
pyjamas.ui.Image.Event = $pyjs.__modules__.pyjamas.ui.Event;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.MouseListener', 'pyjamas.ui.pyjamas.ui', 'pyjamas.ui.MouseListener', 'pyjamas.ui'], 'pyjamas.ui.MouseListener', 'pyjamas.ui.Image');
pyjamas.ui.Image.MouseListener = $pyjs.__modules__.pyjamas.ui.MouseListener;
pyjamas.ui.Image.prefetchImages = new pyjslib.Dict([]);
pyjamas.ui.Image.Image = (function(){
	var cls_instance = pyjs__class_instance('Image');
	var cls_definition = new Object();
	cls_definition.__md5__ = '09548406bdbe2060632d1827cbed81da';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(url) {
		if (this.__is_instance__ === true) {
			var self = this;
			var kwargs = arguments.length >= 2 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		} else {
			var self = arguments[0];
			url = arguments[1];
			var kwargs = arguments.length >= 3 ? arguments[arguments.length-1] : arguments[arguments.length];
			if (typeof kwargs != 'object' || kwargs.__is_instance__ !== true || kwargs.__name__ != 'Dict') {
				kwargs = arguments[arguments.length+1];
			}
		}
		if (typeof kwargs == 'undefined') {
			kwargs = pyjslib.Dict({});
			if (typeof url != 'undefined') {
				if (pyjslib.get_pyjs_classtype(url) == 'Dict') {
					kwargs = url;
					url = arguments[2];
				}
			} else 			if (typeof self != 'undefined') {
				if (pyjslib.get_pyjs_classtype(self) == 'Dict') {
					kwargs = self;
					self = arguments[2];
				}
			} else {
			}
		}
		if (typeof url == 'undefined') url=String('');

		if (pyjslib.bool(!(kwargs.has_key(String('StyleName'))))) {
			kwargs.__setitem__(String('StyleName'), String('gwt-Image'));
		}
		if (pyjslib.bool(url)) {
			kwargs.__setitem__(String('Url'), url);
		}
		self.setElement(pyjamas.ui.Image.DOM.createImg());
		self.clickListeners = new pyjslib.List([]);
		self.loadListeners = new pyjslib.List([]);
		self.mouseListeners = new pyjslib.List([]);
		self.sinkEvents(((pyjamas.ui.Image.Event.ONCLICK | pyjamas.ui.Image.Event.MOUSEEVENTS | pyjamas.ui.Image.Event.ONLOAD | pyjamas.ui.Image.Event.ONERROR)));
		pyjs_kwargs_call(pyjamas.ui.Image.Widget, '__init__', null, kwargs, [{}, self]);
		return null;
	}
	, 1, [null,'kwargs','self', 'url']);
	cls_definition.addClickListener = pyjs__bind_method(cls_instance, 'addClickListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.clickListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.addLoadListener = pyjs__bind_method(cls_instance, 'addLoadListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.loadListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.addMouseListener = pyjs__bind_method(cls_instance, 'addMouseListener', function(listener) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			listener = arguments[1];
		}

		self.mouseListeners.append(listener);
		return null;
	}
	, 1, [null,null,'self', 'listener']);
	cls_definition.getUrl = pyjs__bind_method(cls_instance, 'getUrl', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return pyjamas.ui.Image.DOM.getAttribute(self.getElement(), String('src'));
	}
	, 1, [null,null,'self']);
	cls_definition.onBrowserEvent = pyjs__bind_method(cls_instance, 'onBrowserEvent', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var listener,type;
		type = pyjamas.ui.Image.DOM.eventGetType(event);
		if (pyjslib.bool(pyjslib.eq(type, String('click')))) {
			var __listener = self.clickListeners.__iter__();
			try {
				while (true) {
					var listener = __listener.next();
					
					if (pyjslib.bool(pyjslib.hasattr(listener, String('onClick')))) {
						listener.onClick(self);
					}
					else {
						listener(self);
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else if (pyjslib.bool((pyjslib.eq(type, String('mousedown'))) || (pyjslib.eq(type, String('mouseup'))) || (pyjslib.eq(type, String('mousemove'))) || (pyjslib.eq(type, String('mouseover'))) || (pyjslib.eq(type, String('mouseout'))))) {
			pyjamas.ui.Image.MouseListener.fireMouseEvent(self.mouseListeners, self, event);
		}
		else if (pyjslib.bool(pyjslib.eq(type, String('load')))) {
			var __listener = self.loadListeners.__iter__();
			try {
				while (true) {
					var listener = __listener.next();
					
					listener.onLoad(self);
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else if (pyjslib.bool(pyjslib.eq(type, String('error')))) {
			var __listener = self.loadListeners.__iter__();
			try {
				while (true) {
					var listener = __listener.next();
					
					listener.onError(self);
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition.prefetch = pyjs__bind_method(cls_instance, 'prefetch', function(url) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			url = arguments[1];
		}
		var img;
		img = pyjamas.ui.Image.DOM.createImg();
		pyjamas.ui.Image.DOM.setAttribute(img, String('src'), url);
		pyjamas.ui.Image.prefetchImages.__setitem__(url, img);
		return null;
	}
	, 1, [null,null,'self', 'url']);
	cls_definition.setUrl = pyjs__bind_method(cls_instance, 'setUrl', function(url) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			url = arguments[1];
		}

		pyjamas.ui.Image.DOM.setAttribute(self.getElement(), String('src'), url);
		return null;
	}
	, 1, [null,null,'self', 'url']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.Image.Widget));
})();
return this;
}; /* end pyjamas.ui.Image */
$pyjs.modules_hash['pyjamas.ui.Image'] = $pyjs.loaded_modules['pyjamas.ui.Image'];


 /* end module: pyjamas.ui.Image */


/*
PYJS_DEPS: ['pyjamas.DOM', 'pyjamas', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui', 'pyjamas.ui.Widget', 'pyjamas.ui.Event', 'pyjamas.ui.MouseListener']
*/

/* start module: pyjamas.ui.RootPanel */
pyjamas.ui.RootPanel = $pyjs.loaded_modules["pyjamas.ui.RootPanel"] = function (__mod_name__) {
if(pyjamas.ui.RootPanel.__was_initialized__) return pyjamas.ui.RootPanel;
pyjamas.ui.RootPanel.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'pyjamas.ui.RootPanel';
var __name__ = pyjamas.ui.RootPanel.__name__ = __mod_name__;
var RootPanel = pyjamas.ui.RootPanel;

pyjslib.__import__(['pyjamas.ui.sys', 'sys'], 'sys', 'pyjamas.ui.RootPanel');
pyjamas.ui.RootPanel.sys = $pyjs.__modules__.sys;
pyjslib.__import__(['pyjamas.ui.pyjamas.DOM', 'pyjamas.ui.pyjamas', 'pyjamas.DOM', 'pyjamas'], 'pyjamas.DOM', 'pyjamas.ui.RootPanel');
pyjamas.ui.RootPanel.DOM = $pyjs.__modules__.pyjamas.DOM;
pyjslib.__import__(['pyjamas.ui.pyjamas.Window', 'pyjamas.ui.pyjamas', 'pyjamas.Window', 'pyjamas'], 'pyjamas.Window', 'pyjamas.ui.RootPanel');
pyjamas.ui.RootPanel.Window = $pyjs.__modules__.pyjamas.Window;
pyjslib.__import__(['pyjamas.ui.pyjamas.ui.AbsolutePanel.AbsolutePanel', 'pyjamas.ui.pyjamas.ui.AbsolutePanel', 'pyjamas.ui.AbsolutePanel.AbsolutePanel', 'pyjamas.ui.AbsolutePanel'], 'pyjamas.ui.AbsolutePanel.AbsolutePanel', 'pyjamas.ui.RootPanel');
pyjamas.ui.RootPanel.AbsolutePanel = $pyjs.__modules__.pyjamas.ui.AbsolutePanel.AbsolutePanel;
pyjamas.ui.RootPanel.rootPanels = new pyjslib.Dict([]);
pyjamas.ui.RootPanel.RootPanelCls = (function(){
	var cls_instance = pyjs__class_instance('RootPanelCls');
	var cls_definition = new Object();
	cls_definition.__md5__ = '1d703ca666480705014639f4993d4e20';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
		}
		if (typeof element == 'undefined') element=null;

		pyjamas.ui.RootPanel.AbsolutePanel.__init__(self);
		if (pyjslib.bool((element === null))) {
			element = self.getBodyElement();
		}
		self.setElement(element);
		self.onAttach();
		return null;
	}
	, 1, [null,null,'self', 'element']);
	cls_definition.getBodyElement = pyjs__bind_method(cls_instance, 'getBodyElement', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return $doc.body;
	}
	, 1, [null,null,'self']);
	cls_definition.get = pyjs__bind_method(cls_instance, 'get', function(id) {
    var cls = this.prototype;
		if (typeof id == 'undefined') id=null;
		var element,panel;
		if (pyjslib.bool(pyjamas.ui.RootPanel.rootPanels.has_key(id))) {
			return pyjamas.ui.RootPanel.rootPanels.__getitem__(id);
		}
		element = null;
		if (pyjslib.bool(id)) {
			element = pyjamas.ui.RootPanel.DOM.getElementById(id);
			if (pyjslib.bool(!(element))) {
				return null;
			}
		}
		if (pyjslib.bool((pyjslib.cmp(pyjslib.len(pyjamas.ui.RootPanel.rootPanels), 1) == -1))) {
			cls.hookWindowClosing();
		}
		panel = pyjamas.ui.RootPanel.RootPanel(element);
		pyjamas.ui.RootPanel.rootPanels.__setitem__(id, panel);
		return panel;
	}
	, 2, [null,null,'cls', 'id']);
	cls_definition.hookWindowClosing = pyjs__bind_method(cls_instance, 'hookWindowClosing', function() {
    var cls = this.prototype;

		pyjamas.ui.RootPanel.Window.addWindowCloseListener(cls);
		return null;
	}
	, 2, [null,null,'cls']);
	cls_definition.onWindowClosed = pyjs__bind_method(cls_instance, 'onWindowClosed', function() {
    var cls = this.prototype;
		var panel;
		var __panel = pyjamas.ui.RootPanel.rootPanels.itervalues().__iter__();
		try {
			while (true) {
				var panel = __panel.next();
				
				panel.onDetach();
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 2, [null,null,'cls']);
	cls_definition.onWindowClosing = pyjs__bind_method(cls_instance, 'onWindowClosing', function() {
    var cls = this.prototype;

		return null;
	}
	, 2, [null,null,'cls']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjamas.ui.RootPanel.AbsolutePanel));
})();
pyjamas.ui.RootPanel.RootPanel = function(element) {
	if (typeof element == 'undefined') element=null;

	if (pyjslib.bool(pyjslib.isinstance(element, pyjslib.str))) {
		return pyjamas.ui.RootPanel.RootPanelCls().get(element);
	}
	return pyjamas.ui.RootPanel.RootPanelCls(element);
};
pyjamas.ui.RootPanel.RootPanel.__name__ = 'RootPanel';

pyjamas.ui.RootPanel.RootPanel.__bind_type__ = 0;
pyjamas.ui.RootPanel.RootPanel.__args__ = [null,null,'element'];
return this;
}; /* end pyjamas.ui.RootPanel */
$pyjs.modules_hash['pyjamas.ui.RootPanel'] = $pyjs.loaded_modules['pyjamas.ui.RootPanel'];


 /* end module: pyjamas.ui.RootPanel */


/*
PYJS_DEPS: ['sys', 'pyjamas.DOM', 'pyjamas', 'pyjamas.Window', 'pyjamas.ui.AbsolutePanel.AbsolutePanel', 'pyjamas.ui', 'pyjamas.ui.AbsolutePanel']
*/


/* late static js libs */



var wait_count = 0;

var onExecutionError = function (exception, name) {
    var extra = sys.trackstackstr();
    if (extra == '') {
        if (exception.name.indexOf('HaltException', 0) < 0) { 
            extra = "\n.  Rebuild with pyjsbuild -d for more information.";
        }
    } else {
        extra = "\n" + extra;
    }
    alert( "In application " + name + " - " + 
          exception.name + ': '  + exception.message + extra);
};

function app_imported() {
    pyjslib('pyjslib');
    $pyjs.__modules__.pyjslib = $pyjs.loaded_modules['pyjslib']
    pyjslib.__import__(
               ['index'],
               'index',
               'index',
               '__main__');
    return;
}

function prepare_app() {
    var startWait = 30000;
    var diffWait = 10000;
    var startAt = (new Date()).getTime();
    var waitUntil = startAt + startWait;
    // Wait until all (dynamic) modules are loaded, and then call app_imported()
    var wait_for_loading_modules = function ( proceed_fn, module_list ) {
        var timeoutperiod = 100;
        var wait = function ( ) {
            var notLoaded = [];
            for (var i in module_list) {
                if (typeof $pyjs.loaded_modules[module_list[i]] != 'function') {
                    notLoaded.push(module_list[i]);
                }
            }
            if (notLoaded.length != 0) {
                var now = new Date();
                if (now.getTime() >= waitUntil) {
                    var msg = "Module not loaded yet: " + notLoaded.length
                    if (notLoaded.length <= 2) {
                        msg += "\n" + notLoaded.toString();
                    }
                    msg += "\n" + "Wait for missing modules?"
                    var answer = $wnd.confirm(msg);
                    if (answer == false) {
                        proceed_fn();
                        return;
                    }
                    waitUntil = (new Date()).getTime() + diffWait;
                }
                setTimeout(wait, timeoutperiod);
            } else {
                proceed_fn();
            }
        };
        wait();
    }
    wait_for_loading_modules(app_imported, ['pyjslib','sys','index','pyjd','pyjamas','pyjamas.Window','pyjamas.Location','pyjamas.HTTPRequest','pygwt','pyjamas.JSONService','pyjamas.JSONParser','math','jsonrpc','jsonrpc.json','pyjamas.ui','pyjamas.ui.decoratorpanel','pyjamas.DOM','pyjamas.ui.SimplePanel','pyjamas.ui.Panel','pyjamas.ui.Widget','pyjamas.log','pyjamas.ui.UIObject','pyjamas.ui.Event','pyjamas.ui.TabPanel','pyjamas.ui.Composite','pyjamas.ui.DeckPanel','pyjamas.ui.ComplexPanel','pyjamas.ui.VerticalPanel','pyjamas.ui.CellPanel','pyjamas.ui.TabBar','pyjamas.ui.HTML','pyjamas.ui.Label','pyjamas.ui.MouseListener','pyjamas.ui.HorizontalPanel','pyjamas.ui.ClickDelegatePanel','pyjamas.ui.Focus','pyjamas.ui.KeyboardListener','pyjamas.ui.Button','pyjamas.ui.ButtonBase','pyjamas.ui.FocusWidget','pyjamas.ui.FocusListener','pyjamas.ui.Grid','pyjamas.ui.HTMLTable','pyjamas.ui.CellFormatter','pyjamas.ui.RowFormatter','pyjamas.ui.CheckBox','pyjamas.ui.AbsolutePanel','pyjamas.ui.RadioButton','pyjamas.ui.Image','pyjamas.ui.RootPanel']);
}

function pygwtOnLoad(onLoadError, name) {
    if (onLoadError != null)
        try {
            prepare_app();
        } catch (exception) {
            onLoadError(exception, name);
        }
    else {
        prepare_app();
    }
}

$pyjs.script_onload = function (modname) {
    $pyjs.loaded_modules[modname] = function () { return null };
}

$pyjs.script_onreadystate = function (modname) {
    if (js.readyState == 'complete') {
        $pyjs.script_onload(modname);
    }
}
--></script>





</body>
</html>
